1
0
mirror of https://github.com/stolksdorf/homebrewery.git synced 2025-12-12 23:45:57 +00:00

Config: Read MongoDB URL from config files too.

This commit is contained in:
Rae Che
2018-05-07 10:21:15 +01:00
committed by Trevor Buckner
parent 31cbd9ef40
commit b8105eb147

View File

@@ -15,7 +15,7 @@ const config = require('nconf')
//DB
const mongoose = require('mongoose');
mongoose.connect(process.env.MONGODB_URI || process.env.MONGOLAB_URI || 'mongodb://localhost/naturalcrit');
mongoose.connect(config.get('mongodb_uri') || config.get('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.');