From 029dfb6f3bdfa41d0101d3a464a2e426d29178a2 Mon Sep 17 00:00:00 2001 From: Anatoliy Chakkaev Date: Thu, 4 Apr 2013 22:24:56 +0400 Subject: [PATCH] Allow database.js to export function(compound) --- lib/railway.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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;