diff --git a/lib/railway.js b/lib/railway.js index 6f4fb7b5..5c897cd5 100644 --- a/lib/railway.js +++ b/lib/railway.js @@ -27,7 +27,14 @@ module.exports = function init(root) { var confFile = (root || app.root) + '/config/database'; var config = {}; - if (existsSync(confFile + '.json')) { + if (existsSync(confFile + '.js')) { + try { + config = require(confFile + '.js'); + } catch (e) { + console.log('Could not load config/database.js'); + throw e; + } + } else if (existsSync(confFile + '.json')) { try { config = JSON.parse(fs.readFileSync(confFile + '.json', 'utf-8'))[app.set('env')]; } catch (e) {