Skip to content
Permalink
Browse files

serve other routes

eg http://localhost:3000/about
  • Loading branch information...
BradDenver committed Dec 31, 2014
1 parent 507b3a1 commit d7216b99cc619693ac9a57769824800f8bc09ca8
Showing with 8 additions and 2 deletions.
  1. +2 −0 .gitignore
  2. +0 −1 dev/index.html
  3. +6 −1 server.js
@@ -1,3 +1,5 @@
/node_modules/

/bower_components/

/dev/index.html

This file was deleted.

Oops, something went wrong.
@@ -21,7 +21,12 @@ var server = new WebpackDevServer(webpack(config), {
publicPath: config.output.publicPath,
hot: true
});

// allow server to render any route
server.use('/', function(req, res) {
Router.run(Routes, req.path, function (Handler) {
res.send(React.renderToString(React.createElement(Handler, null)));
});
});
server.listen(3000, 'localhost', function (err, result) {
if (err) {
console.log(err);

0 comments on commit d7216b9

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.