diff options
author | BoHong Li | 2017-04-13 01:57:55 +0800 |
---|---|---|
committer | Raccoon Li | 2017-05-08 19:29:07 +0800 |
commit | ecb05336055a37ba8a03c119995cd37d96aad90d (patch) | |
tree | f6815f5ce06befbe3bdb51cfd941d2c6edaf51a0 /lib/models | |
parent | 4738ba7d364111adeb2eb2036d0b24d53a80c0c7 (diff) |
refactor(config.js): Extract config file
* Separate different config source to each files
* Freeze config object
Diffstat (limited to '')
-rw-r--r-- | lib/models/index.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/models/index.js b/lib/models/index.js index 458d5319..0679a7fc 100644 --- a/lib/models/index.js +++ b/lib/models/index.js @@ -3,13 +3,14 @@ var fs = require('fs') var path = require('path') var Sequelize = require('sequelize') +const {cloneDeep} = require('lodash') // core var config = require('../config') var logger = require('../logger') -var dbconfig = config.db -dbconfig.logging = config.debug ? logger.info : false +var dbconfig = cloneDeep(config.db) +dbconfig.logger = config.debug ? logger.info : false var sequelize = null |