Skip to content

Instantly share code, notes, and snippets.

@smagch
Created May 10, 2018 02:53
Show Gist options
  • Save smagch/963b5ef033ff8163b55af79c7c88303e to your computer and use it in GitHub Desktop.
Save smagch/963b5ef033ff8163b55af79c7c88303e to your computer and use it in GitHub Desktop.
Sequelize Config with config module
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