-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switched everything to nconf & cleaned up some files
Signed-off-by: Henry Gressmann <[email protected]>
- Loading branch information
1 parent
a9f8758
commit d9e2bb4
Showing
14 changed files
with
914 additions
and
746 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
var config = require('../serverconfig'); | ||
const nconf = require('nconf'); | ||
|
||
function Database(){ | ||
config.db.dbType = config.db.dbType.toLowerCase() || 'level'; | ||
|
||
switch(config.db.dbType){ | ||
function Database() { | ||
nconf.defaults({ | ||
'db:dbType': 'level' | ||
}); | ||
switch (nconf.get('db:dbType')) { | ||
case 'level': | ||
return require('./db_level'); | ||
case 'mysql': | ||
return require('./db_mysql'); | ||
case 'mongo': | ||
return require('./db_mongo'); | ||
default: | ||
return require('./db_level'); | ||
} | ||
} | ||
|
||
module.exports = new Database(); | ||
module.exports = new Database(); |
This file contains 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
Oops, something went wrong.