From 6dc7404f23796784c212e6db1b4fca22c7a1ac82 Mon Sep 17 00:00:00 2001 From: Maxime Quandalle Date: Mon, 28 Dec 2015 22:59:39 +0100 Subject: Share the router configuration between the client and the server --- sandstorm.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'sandstorm.js') diff --git a/sandstorm.js b/sandstorm.js index 11bafa10..def07eea 100644 --- a/sandstorm.js +++ b/sandstorm.js @@ -51,10 +51,8 @@ if (isSandstorm && Meteor.isServer) { // XXX Maybe the sandstorm http-bridge could provide some kind of "home URL" // in the manifest? const base = req.headers['x-sandstorm-base-path']; - // XXX If this routing scheme changes, this will break. We should generate - // the location URL using the router, but at the time of writing, the - // it is only accessible on the client. - const boardPath = `/b/${sandstormBoard._id}/${sandstormBoard.slug}`; + const { _id, slug } = sandstormBoard; + const boardPath = FlowRouter.path('board', { id: _id, slug }); res.writeHead(301, { Location: base + boardPath, -- cgit v1.2.3-1-g7c22