mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-07-08 15:03:05 +02:00
updating 0.4.0 merged branch to support the declerative db connection object instead of just a connection string
This commit is contained in:
8
config/env/development.js
vendored
8
config/env/development.js
vendored
@@ -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',
|
||||
|
||||
@@ -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!'));
|
||||
|
||||
Reference in New Issue
Block a user