Skip to content

Commit 8dc3a11

Browse files
authored
Added production warning re: NODE_ENV
1 parent e0ad6ae commit 8dc3a11

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,11 @@ In production environments, you should ensure that `RENDER` is set to True.
196196
You will want to run the render server under whatever supervisor process suits your need. Depending on
197197
your setup, you may need to change the `RENDER_URL` setting to reflect your environment.
198198

199+
The render server should be run with the `NODE_ENV` environment variable set to `production`,
200+
eg: `NODE_ENV=production node render_server.js`. React defaults to development mode and relies on the
201+
`NODE_ENV` variable to deactivate dev-oriented code (types and constraint checking) that slows down renders.
202+
Defining this variable will ensure that your code is rendered much faster.
203+
199204
Depending on your load, you may want to use a worker farm to handle rendering. Node's
200205
[cluster module](https://nodejs.org/api/cluster.html) provides an easy way to fork a process and serve
201206
multiple instances from a single network address.

0 commit comments

Comments
 (0)