From 2c790c518c274004e571964afea4b3960354799a Mon Sep 17 00:00:00 2001 From: Mario Colque Date: Fri, 31 Jan 2014 15:00:48 -0300 Subject: [PATCH] new config --- config/config.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/config/config.js b/config/config.js index d0d2408..dc6eb10 100644 --- a/config/config.js +++ b/config/config.js @@ -4,13 +4,26 @@ * Module dependencies. */ var path = require('path'), - rootPath = path.normalize(__dirname + '/..'); + rootPath = path.normalize(__dirname + '/..'), + env; + +switch(process.env.NODE_ENV) { + case 'production': + env = 'prod'; + break; + case 'test': + env = 'test'; + break; + default: + env = 'dev'; + break; +} module.exports = { root: rootPath, - appName: 'Insight', + appName: 'Insight ' + env, port: process.env.PORT || 3000, - db: 'mongodb://localhost/insight-test', + db: 'mongodb://localhost/insight-' + env, bitcoind: { protocol: process.env.BITCOIND_PROTO || 'http', user: process.env.BITCOIND_USER || 'user',