diff --git a/db/mongodb.js b/db/mongodb.js index 40f7695..57f1b72 100644 --- a/db/mongodb.js +++ b/db/mongodb.js @@ -4,9 +4,7 @@ const mongoose = require('mongoose') const schema = require('./schema') // the default mongodb url (local server) -let mongodbURL = `mongodb://127.0.0.1:27017` -const envMongoURL = process.env.DB_URL -if (envMongoURL) mongodbURL = envMongoURL +const mongodbURL = process.env.DB_URL || 'mongodb://127.0.0.1:27017' mongoose.connect(mongodbURL, { useNewUrlParser: true, @@ -38,4 +36,4 @@ module.exports = { getNum, getAll, setNum -} \ No newline at end of file +}