updating 0.4.0 merged branch to support the declerative db connection object instead of just a connection string

This commit is contained in:
Liran Tal
2015-07-02 12:29:09 +03:00
parent 67e96a4f22
commit b76c2cd13b
2 changed files with 8 additions and 2 deletions

View File

@@ -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',

View File

@@ -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!'));