Skip to content

Instantly share code, notes, and snippets.

@jbgutierrez
Created June 28, 2017 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbgutierrez/3ad096c9169089007ec823e7cb5c6df4 to your computer and use it in GitHub Desktop.
Save jbgutierrez/3ad096c9169089007ec823e7cb5c6df4 to your computer and use it in GitHub Desktop.
Gestión de la configuración
const config = require('./config');
console.log(config);
const config = require('./config.json');
Object.assign(module.exports, config.defaults, config[process.env.NODE_ENV])
{
"defaults": {
"hello": "world",
"foo": "bar"
},
"local": {
"foo": "bar local"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment