From 321962f08b9e8f9c1e02436394e36796785447f6 Mon Sep 17 00:00:00 2001 From: mhiner Date: Fri, 19 Jun 2015 17:24:00 -0400 Subject: [PATCH] update history.js to be consistent with changes in DRE. This allows for deployment with remote mongodb, a requirement for a docker deployment. --- lib/history.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/history.js b/lib/history.js index d06026c..4a10045 100644 --- a/lib/history.js +++ b/lib/history.js @@ -2,7 +2,11 @@ var mongoose = require('mongoose'); var Schema = mongoose.Schema; -mongoose.connect('mongodb://localhost:27017/dre'); + +var mongo_url = process.env.MONGO_DB || 'localhost'; +var mongo_port = process.env.MONGO_PORT || 27017; +var mongo_name = process.env.MONGO_NAME || 'dre'; +mongoose.connect('mongodb://'+mongo_url+':'+mongo_port+'/'+mongo_name); exports.getFullEventName = function (typestring, callback) { var fullEventNames = {