This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Pass the env-vars to MYCOMMAND | |
eval $(egrep -v '^#' .env | xargs) MYCOMMAND | |
# … or ... | |
# Export the vars in .env into your shell: | |
export $(egrep -v '^#' .env | xargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This module loads a config file in the current working directory matching the NODE_ENV variable. | |
// I.e. either './development.js' or './production.js' based on the process.env.NODE_ENV variable. | |
// If not set, it defaults to './development.js'. | |
// Can load custom environment files as well, as long as the NODE_ENV variable matches | |
// a file in the current directory. E.g. './staging.js' | |
// Usage: calling code can just require this module, e.g. "var config = require('./config')" | |
// assuming this file is named "index.js" and lives in a subdirectory named "config" of the app root. | |
var config | |
, config_file = './' + (process.env.NODE_ENV ? process.env.NODE_ENV : 'development') + '.js'; |