update server code to work with updated mongoose version
This commit is contained in:
parent
cee9fa7441
commit
a4a01cef4c
1 changed files with 2 additions and 1 deletions
|
@ -122,7 +122,8 @@ require('./config/passport');
|
|||
|
||||
// Connect to MongoDB
|
||||
mongoose.Promise = global.Promise;
|
||||
mongoose.connect(mongoConnectionString, { useMongoClient: true });
|
||||
mongoose.connect(mongoConnectionString, { useNewUrlParser: true, useUnifiedTopology: true });
|
||||
mongoose.set('useCreateIndex', true);
|
||||
mongoose.connection.on('error', () => {
|
||||
console.error('MongoDB Connection Error. Please make sure that MongoDB is running.');
|
||||
process.exit(1);
|
||||
|
|
Loading…
Reference in a new issue