From b76c2cd13ba2c63a3bd26e9c75a828d14100867a Mon Sep 17 00:00:00 2001 From: Liran Tal Date: Thu, 2 Jul 2015 12:29:09 +0300 Subject: [PATCH] updating 0.4.0 merged branch to support the declerative db connection object instead of just a connection string --- config/env/development.js | 8 +++++++- config/lib/mongoose.js | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/config/env/development.js b/config/env/development.js index 9b31b3b04f..ab18fd0f9f 100644 --- a/config/env/development.js +++ b/config/env/development.js @@ -1,7 +1,13 @@ 'use strict'; module.exports = { - db: 'mongodb://localhost/mean-dev', + db: { + uri: 'mongodb://localhost/mean-test', + options: { + user: '', + pass: '' + } + }, log: { // Can specify one of 'combined', 'common', 'dev', 'short', 'tiny' format: 'dev', diff --git a/config/lib/mongoose.js b/config/lib/mongoose.js index 51eb37f76a..731abb62b8 100644 --- a/config/lib/mongoose.js +++ b/config/lib/mongoose.js @@ -20,7 +20,7 @@ module.exports.loadModels = function() { module.exports.connect = function(cb) { var _this = this; - var db = mongoose.connect(config.db, function (err) { + var db = mongoose.connect(config.db.uri, config.db.options, function (err) { // Log Error if (err) { console.error(chalk.red('Could not connect to MongoDB!'));