What is the easiest method to let express know what environment I am in? E.g. I want do do the below to make a connection to redis depending on what env I am in. Can this
I did somthing even more comprehensive by ordering the sources of such parameters :
var env = process.argv[2] || process.env.NODE_ENV || 'development'
var mongourl = process.argv[3] || process.env.NODE_DB || 'mongodb://localhost/default'
var port = process.env.PORT || 9001
This way you can use command line args, env settings and default values.