Node / express: set NODE_ENV when using Forever to run the script continuously

how can I set the variable / parameter NODE_ENV to "production" when I use forever to run my node script

I got this so far:

forever start -l forever.log -o out.log -e err.log -a app.js 
+45
express
Oct 6 '11 at 12:59
source share
1 answer

You can set NODE_ENV as usual and then run forever:

  NODE_ENV = production forever [flags] start app.js [app_flags] 

The initial NODE_ENV will be saved when the server restarts - this has been fixed in this problem:

https://github.com/nodejitsu/forever/issues/116

In older versions of forever, you can use the following command line format:

  NODE_ENV = production forever [flags] app.js 
+77
Oct 06 '11 at 1:59 a.m.
source share



All Articles