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
Just set the NODE_ENV environment variable to production or development, as seen in express' docs: http://expressjs.com/guide.html#configuration
NODE_ENV
production
development
I just leave NODE_ENV=development in the dev machine's ~/.profile (.bashrc or bash_profile on linux), and do the same for production ones.
NODE_ENV=development
~/.profile