Skip to content
Permalink
Browse files

Implement NODE_ENV, EXPRESS_ENV is now deprecated

spark, connect, and express will from now on utilize NODE_ENV.
EXPRESS_ENV support will remain until 1.0
  • Loading branch information...
tj committed Oct 1, 2010
1 parent 1f79ce4 commit 03b56d8140dc5c2b574d410bfeb63517a0430451
Showing with 10 additions and 6 deletions.
  1. +1 −1 Makefile
  2. +8 −4 lib/express/server.js
  3. +1 −1 test/express.test.js
@@ -37,7 +37,7 @@ uninstall-docs:
rm -f $(PREFIX)/share/man/man1/express.1

test:
@CONNECT_ENV=test ./support/expresso/bin/expresso \
@NODE_ENV=test ./support/expresso/bin/expresso \
-I lib \
-I support/connect/lib \
-I support/haml/lib \
@@ -37,10 +37,14 @@ var Server = exports = module.exports = function Server(middleware){
// Default "home" to /
this.set('home', '/');

// Set "env" to EXPRESS_ENV or connectEnv.name
this.set('env',
process.env.EXPRESS_ENV ||
process.connectEnv.name);
// DEPRECATED: remove in 1.0
if (process.env.EXPRESS_ENV) {
process.env.NODE_ENV = process.env.EXPRESS_ENV;
console.warn('\x1b[33mWarning\x1b[0m: EXPRESS_ENV is deprecated, use NODE_ENV.');
}

// Set "env" to NODE_ENV
this.set('env', process.env.NODE_ENV);

// Expose objects to each other
this.use(function(req, res, next){
@@ -162,7 +162,7 @@ module.exports = {

'test #configure()': function(assert, beforeExit){
var calls = [];
process.env.EXPRESS_ENV = 'development';
process.env.NODE_ENV = 'development';
var server = express.createServer();

// Config blocks

0 comments on commit 03b56d8

Please sign in to comment.
You can’t perform that action at this time.