Very simple example project for react-server
using styled-components
To start in development mode:
npm start
Then go to localhost:3000. You will see a simple page
that pre-renders with styled-components
and that is interactive on load. It also will include hot
reloading of React components in their own file.
If you want to optimize the client code at the expense of startup time, type
NODE_ENV=production npm start
. You can also use any
react-server-cli arguments
after --
. For example:
# start in dev mode on port 4000
npm start -- --port=4000
To run the tests
npm test
There are three tests called by the testing target; to run them independently you'll likely want to install some dependencies globally
npm i -g eslint eslint-plugin-react babel-eslint ava nsp
The first test is a linter, which checks for common bugs and code style; you can
run it with eslint <file-or-directory>
.
The second test is a security auditing test, which checks for known security
issues with the installed dependencies; you can run it with nsp check
.
The last test is an end-to-end test, which starts the server and checks that it
serves pages correctly; you can run it with ava test.js
.