Reputation: 10864
I'm using Express for framework.
And I would like to divide my configuration to "development" and "production".
I know that I can use
app.configure('development', function() {});
app.configure('production', function() {});
But I want to know the way actually how I can know what the NODE_ENV value is.
I tried to find in global variables but I could not find.
I really need this to use other Database configuration depends on NODE_ENV
in my database config.js file.
Upvotes: 22
Views: 14770
Reputation: 4283
Or alternatively ...
var express = require('express');
var app = express();
app.get('env');
Upvotes: 0