Update server.js (#9)

Fixes DeprecationWarning: `open()` is deprecated in mongoose >= 4.11.0, use `openUri()` instead
See: https://github.com/Automattic/mongoose/issues/5399
This commit is contained in:
Abhijeet Singh 2020-11-11 03:25:06 +05:30 committed by GitHub
parent b1305f7fc2
commit 1a4be7f98a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,7 +5,7 @@ const bodyParser = require('body-parser')
const cors = require('cors')
const mongoose = require('mongoose')
mongoose.connect(process.env.MLAB_URI || 'mongodb://localhost/exercise-track' )
mongoose.connect(process.env.MLAB_URI || 'mongodb://localhost/exercise-track', { useMongoClient: true } )
app.use(cors())