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
cjohn Oct 06 '11 at 1:59 a.m. 2011-10-06 13:59
source share