diff --git a/lib/railway.js b/lib/railway.js index 706e7c12..3fd83534 100644 --- a/lib/railway.js +++ b/lib/railway.js @@ -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;