title: Using NODE_ENV with multiple environments in JavaScript projects
body: <p>I work on many projects that run on Express servers, whether they are front-end (i.e. React.js) codebases or server-side <code>Node.js</code> <code>codebases</code>.</p>
  
  <p>Many times with the front-end <code>codebases</code> I would load conditional configuration based on <code>NODE_ENV</code>, such as the URL of the restful API that the front-end makes requests to.  </p>
  
  <p>I many times also used NODE_ENV to conditionally load things like DB configuration for server-side <code>Node.js</code> projects.  </p>
  
  <p>On a project that consisted of development, staging, and production (3 environments), I would usually set up my code to load configuration based on the <code>NODE_ENV</code> being set to any one of those 3 environments (and maybe also "local"). </p>
  
  <p>I was recently working on a project that was referring to the production environment as "live." </p>
  
  <p>When I decided to set the NODE_ENV=live for this environment, a coworker pointed out a major flaw with this approach.</p>
  
  <p>It seems that Express and some other libraries for Node.js latch onto the fact that you will either be using "production" or "development" as your <code>NODE_ENV</code> and using other names for your environments can have unexpected effects.  </p>
  
  <p><strong>For example</strong>, Express needs <code>NODE_ENV=production</code> in order to run in "production" mode.  According to the Express docs "Tests indicate that just doing this can improve app performance by a factor of three!"</p>
  
  <p>Basically, I'm curious if it is considered common practice to set the <code>NODE_ENV</code> to values other than "development" and "production," like I've been doing in my projects. </p>
  
  <p>I feel that if I'm going to deploy my code to the development or staging environments on the cloud, I don't think they should run in a different Express "mode" than the production environment. </p>
  
  <p>Does it make more sense to maintain configurations separate from <code>NODE_ENV</code>?  </p>
  
  <p><strong>For example</strong>, does it make sense to base your configuration off of a variable like <code>APP_ENV</code>, while ensuring that <code>NODE_ENV</code> is either "development" or "production" for <code>frameworks/packages</code> like Express.</p>