Set the NODE_ENV environment variable from app.js

This commit is contained in:
Sandro Santilli 2014-03-14 10:48:33 +01:00
parent 67cc05085f
commit 7100da2200

2
app.js
View File

@ -15,6 +15,8 @@ if ( process.argv[2] ) ENV = process.argv[2];
else if ( process.env['NODE_ENV'] ) ENV = process.env['NODE_ENV'];
else ENV = 'development';
process.env['NODE_ENV'] = ENV;
// sanity check arguments
if (ENV != 'development' && ENV != 'production' && ENV != 'test' && ENV != 'staging' ) {
console.error("\nnode app.js [environment]");