Skip to content
This repository was archived by the owner on Dec 20, 2024. It is now read-only.

If no username set in auth then don't use it - this fixes #233 #273

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ var config = require('config');
var semver = require('semver');

// configure mongodb
mongoose.connect(config.mongodb.connectionString || 'mongodb://' + config.mongodb.user + ':' + config.mongodb.password + '@' + config.mongodb.server +'/' + config.mongodb.database);

var userAuthStr = '';
if (config.mongodb.user) {
userAuthStr = config.mongodb.user + ':' + config.mongodb.password + '@';
}
mongoose.connect(config.mongodb.connectionString || 'mongodb://' + userAuthStr + config.mongodb.server +'/' + config.mongodb.database);
mongoose.connection.on('error', function (err) {
console.error('MongoDB error: ' + err.message);
console.error('Make sure a mongoDB server is running and accessible by this application');
Expand Down