From 39125972c3c8e589802319db93387ca2855f2281 Mon Sep 17 00:00:00 2001 From: David Baldwynn Date: Tue, 21 Nov 2017 13:12:34 -0800 Subject: [PATCH] removed user and pass from mongoose options --- config/env/all.js | 2 -- config/env/development.js | 2 -- config/env/test.js | 2 -- server.js | 7 ++++++- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/config/env/all.js b/config/env/all.js index 35456020..4f92ada1 100755 --- a/config/env/all.js +++ b/config/env/all.js @@ -10,8 +10,6 @@ module.exports = { db: { uri: process.env.MONGOLAB_URI || process.env.MONGODB_URI || 'mongodb://'+ (process.env.DB_PORT_27017_TCP_ADDR || '127.0.0.1') + '/mean', options: { - user: '', - pass: '', useMongoClient: true } }, diff --git a/config/env/development.js b/config/env/development.js index 202ea79a..56e175a5 100755 --- a/config/env/development.js +++ b/config/env/development.js @@ -6,8 +6,6 @@ module.exports = { db: { uri: process.env.MONGODB_URI || 'mongodb://'+( process.env.DB_PORT_27017_TCP_ADDR || '127.0.0.1') +'/mean', options: { - user: '', - pass: '', useMongoClient: true } }, diff --git a/config/env/test.js b/config/env/test.js index fceeb365..433ffa13 100755 --- a/config/env/test.js +++ b/config/env/test.js @@ -5,8 +5,6 @@ module.exports = { db: { uri: 'mongodb://localhost/mean-test', options: { - user: '', - pass: '', useMongoClient: true } }, diff --git a/server.js b/server.js index e221d055..10b7e936 100755 --- a/server.js +++ b/server.js @@ -11,7 +11,7 @@ var mongoose = require('mongoose'), * Main application entry file. * Please note that the order of loading is important. */ -module.exports.bootstrap = function() { +var bootstrap = module.exports.bootstrap = function() { //Don't check .env file if we are in travis-ci if(!process.env.TRAVIS) { require('dotenv').config({path: './.env'}); @@ -82,3 +82,8 @@ module.exports.bootstrap = function() { process.exit(1); }); } + +// To maintain backwards compatibility, run bootstrap when called as a file +if(require.main === module) { + bootstrap(); +} \ No newline at end of file