Skip to content

Commit

Permalink
Avoid hardcoding MongoDB DSN.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsegura authored and guillett committed Dec 3, 2018
1 parent 11fe445 commit dfc154d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/lib/stats/mongodb.js
@@ -1,6 +1,7 @@
/* global emit: true */
var Promise = require('bluebird');
var MongoClient = Promise.promisifyAll(require('mongodb').MongoClient);
var config = require('../../config/config');

var db;
function saveDb(refDb) {
Expand Down Expand Up @@ -51,7 +52,7 @@ function formatMongo(data) {

exports.getDailySituationCount = function(fromDate, toDate) {
return MongoClient
.connectAsync('mongodb://localhost:27017/dds')
.connectAsync(config.mongo.uri)
.then(saveDb)
.then(function(db) { return extractSimulationDailyCount(db, fromDate, toDate); })
.catch(manageMissingCollection)
Expand Down

0 comments on commit dfc154d

Please sign in to comment.