Skip to content
Browse files

Set NODE_ENV from the config file unless already defined

  • Loading branch information...
1 parent 2028bf4 commit 55a9044dda564e535ecbf0d7a7857cd564afc992 @aron aron committed Jul 13, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/app.js
View
8 lib/app.js
@@ -23,6 +23,14 @@ app.templates = {};
app.PRODUCTION = 'production';
app.DEVELOPMENT = 'development';
+// Set the NODE_ENV variable as this is used by Express, we want the
+// environment to take precedence but allow it to be set using the config file
+// too.
+if (process.env.NODE_ENV) {
+ options.env = process.env.NODE_ENV;
+}
+process.env.NODE_ENV = options.env;
+
// Sort out the port.
(function (url) {
var port = ''; //process.env.PORT;

0 comments on commit 55a9044

Please sign in to comment.
Something went wrong with that request. Please try again.