diff --git a/lib/railway.js b/lib/railway.js index 14503229..2d014a81 100644 --- a/lib/railway.js +++ b/lib/railway.js @@ -30,7 +30,11 @@ module.exports = function init(root) { try { var cf = require(confFile); if (cf instanceof Array) cf = cf[0]; - config = cf[app.set('env')]; + if (typeof cs === 'function') { + config = cs(railway); + } else { + config = cf[app.set('env')]; + } } catch (e) { console.log('Could not load config/database.{js|json|yml}'); throw e;