Created
May 10, 2018 02:53
-
-
Save smagch/963b5ef033ff8163b55af79c7c88303e to your computer and use it in GitHub Desktop.
Sequelize Config with config module
This file contains hidden or 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
const path = require('path'); | |
const defaults = require('./default.json').db; | |
const config = {}; | |
const envs = [ | |
'test', | |
'development' | |
'production' | |
]; | |
envs.forEach(env => { | |
const envConfig = require(`./${env}.json`).db; | |
config[env] = { ...defaults, ...envConfig }; | |
}); | |
console.log(config); | |
module.exports = config; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment