Server side rendering HTTP server for ReactJS.
It is intended to have dynamic HTML meta tag support (e.g. SEO), though that's still under development.
NOTE! It's pretty experimental and does not work as standalone yet.
Variable name | Description |
---|---|
BUILD_VERSION |
The version to compile in the build. Defaults to package.json version. |
BUILD_NODE_ENV |
The build mode. Defaults to production . |
BUILD_COMMAND_NAME |
The name for the server command in usage help. Defaults to ssr-server |
BUILD_LOG_LEVEL |
THe log level. Defaults to INFO . |
npm i -g @hangovergames/ssr-server
ssr-server /path/to/frontend/build /path/to/frontend/app/App.js /path/to/frontend/app/index.js
...where arguments are:
/path/to/frontend/build
is the directory containing the static document root generated bycreate-react-app
or other build system/path/to/frontend/app/App.js
is the (probably compiled) App for server side rendering/path/to/frontend/app/index.js
is the optional (probably also compiled) entry file for initializing the server side app (e.g. i18n, etc).
Building is only necessary if for development.
npm run build