Server

Development

To run the development server, make sure the project dependencies, including development dependencies, are installed (if in doubt, run make install), then fire up the development server by simply running make.

After a little while, you’ll have three different servers running:

  • On port 3000, the production-like express server will run. Thanks to nodemon, the server will be restarted whenever you change a file. The webpack managed assets won’t be available though, so you should not try to develop looking at this port, it should only be useful to debug server-side rendering issues.
  • On port 3001, Browsersync will serve the real application, by proxying the express server above. It will add some middlewares so your assets are available, and hot module replacement (HMR) will try to hot-swap frontend components that you change. It is not always possible, but it will try its best.
  • On port 3002, Browsersync will serve its management interface. Go ahead and explore the features, as it’s pretty cool.

Production

On production, you’ll run the express server in a context where webpack precompiled all assets, making it effective.

To run it, you can (make build; cd build; node server). Otherwise, you can simply make build and use the release you just build in the build directory to run it however you want. That could be docker (see Docker), but you can pretty much do it any way you want.