Skip to content

Instantly share code, notes, and snippets.

@nazomikan
Last active December 31, 2015 08:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nazomikan/7960370 to your computer and use it in GitHub Desktop.
Save nazomikan/7960370 to your computer and use it in GitHub Desktop.
var path = require('path')
, mode = process.env.NODE_ENV || 'development'
, env = require(path.resolve('resources/environments', mode))
;
console.log(env.WHOAMI);
// output: dev太郎
{
"WHOAMI": "dev太郎"
}
NODE_ENV=production node app.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment