Fix for reading yml files

This commit is contained in:
Anatoliy Chakkaev 2012-12-24 22:17:23 +04:00
parent 1088146986
commit c7409be559
1 changed files with 3 additions and 1 deletions

View File

@ -28,7 +28,9 @@ module.exports = function init(root) {
var config = {};
try {
config = require(confFile)[app.set('env')];
var cf = require(confFile);
if (cf instanceof Array) cf = cf[0];
config = cf[app.set('env')];
} catch (e) {
console.log('Could not load config/database.{js|json|yml}');
throw e;