bananaoomarang / isomorphic-redux

Isomorphic Redux demo, with routing and async actions
https://medium.com/@bananaoomarang/handcrafting-an-isomorphic-redux-application-with-love-40ada4468af4
MIT License
455 stars 87 forks source link

[suggestion] Use a static folder for the assets #17

Closed OlivierCuyp closed 8 years ago

OlivierCuyp commented 9 years ago

I noticed you directly streamed the bundle.js on a specific route like this :

// So the example quote unquote 'production mode' works
import fs from 'fs';
app.use('/bundle.js', function (req, res) {
  return fs.createReadStream('./dist/bundle.js').pipe(res);
});

Wouldn't it be better to serve the all dist folder in case you want to add custom css and other stuff in there ?

// Use to serve public assets
import path from 'path';
app.use(express.static(path.join(__dirname, './dist')));