improvement: improve db/connection.js readability
This commit is contained in:
parent
6826a6516b
commit
901c9d75a0
@ -1,6 +1,5 @@
|
||||
var knex = require('knex'),
|
||||
config = require('../../config'),
|
||||
dbConfig = config.database,
|
||||
knexInstance;
|
||||
|
||||
function configure(dbConfig) {
|
||||
@ -47,8 +46,8 @@ function configure(dbConfig) {
|
||||
return dbConfig;
|
||||
}
|
||||
|
||||
if (!knexInstance && dbConfig && dbConfig.client) {
|
||||
knexInstance = knex(configure(dbConfig));
|
||||
if (!knexInstance && config.database && config.database.client) {
|
||||
knexInstance = knex(configure(config.database));
|
||||
}
|
||||
|
||||
module.exports = knexInstance;
|
||||
|
Loading…
Reference in New Issue
Block a user