Skip to content
Myr

Implement NODE_ENV, EXPRESS_ENV is now deprecated

Before adoption: this commit came in with the history the project adopted, so no landing records it.

spark, connect, and express will from now on utilize NODE_ENV. EXPRESS_ENV support will remain until 1.0

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent 1f79ce4 · Browse files · 3 files+10 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+10 added−6 removed

  • tests:+1 added−1 removed
  • other:+9 added−5 removed

3 files+10 added−6 removed

modified:lib/express/server.js+8 added-4 removed
35 unmodified lines
3637 // Default "home" to / 38 this.set('home', '/');3940 // Set "env" to EXPRESS_ENV or connectEnv.name41 this.set('env',42 process.env.EXPRESS_ENV ||43 process.connectEnv.name);40 // DEPRECATED: remove in 1.041 if (process.env.EXPRESS_ENV) {42 process.env.NODE_ENV = process.env.EXPRESS_ENV;43 console.warn('\x1b[33mWarning\x1b[0m: EXPRESS_ENV is deprecated, use NODE_ENV.');44 }4546 // Set "env" to NODE_ENV47 this.set('env', process.env.NODE_ENV);4849 // Expose objects to each other50 this.use(function(req, res, next){51 req.query = {};52 res.headers = {};
265 unmodified lines
modified:test/express.test.js+1 added-1 removed
160 unmodified lines
161 },162 163 'test #configure()': function(assert, beforeExit){164 var calls = [];165 process.env.EXPRESS_ENV = 'development';165 process.env.NODE_ENV = 'development';166 var server = express.createServer();167 168 // Config blocks169 var ret = server.configure(function(){
156 unmodified lines
modified:Makefile+1 added-1 removed
35 unmodified lines
36uninstall-docs:37 rm -f $(PREFIX)/share/man/man1/express.13839test:40 @CONNECT_ENV=test ./support/expresso/bin/expresso \40 @NODE_ENV=test ./support/expresso/bin/expresso \41 -I lib \42 -I support/connect/lib \43 -I support/haml/lib \44 -I support/jade/lib \
30 unmodified lines