1
0
mirror of https://github.com/stolksdorf/homebrewery.git synced 2025-12-13 18:06:03 +00:00

upgrading to mongoose v5

This commit is contained in:
Scott Tolksdorf
2018-04-09 00:11:32 -04:00
committed by Trevor Buckner
parent 4c36f254c4
commit 439cdfa1ea
4 changed files with 34 additions and 62 deletions

View File

@@ -14,12 +14,13 @@ const config = require('nconf')
.file('defaults', { file: 'config/default.json' });
//DB
require('mongoose')
.connect(process.env.MONGODB_URI || process.env.MONGOLAB_URI || 'mongodb://localhost/naturalcrit')
.connection.on('error', ()=>{
console.log('Error : Could not connect to a Mongo Database.');
console.log(' If you are running locally, make sure mongodb.exe is running.');
});
const mongoose = require('mongoose');
mongoose.connect(process.env.MONGODB_URI || process.env.MONGOLAB_URI || 'mongodb://localhost/naturalcrit');
mongoose.connection.on('error', ()=>{
console.log('Error : Could not connect to a Mongo Database.');
console.log(' If you are running locally, make sure mongodb.exe is running.');
throw 'Can not connect to Mongo';
});
//Account MIddleware