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:
committed by
Trevor Buckner
parent
4c36f254c4
commit
439cdfa1ea
13
server.js
13
server.js
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user