From 22387fe0d3b1f2c5c08ddd2367fbc191efb1a32f Mon Sep 17 00:00:00 2001 From: Divyanshu Rathore Date: Mon, 24 Sep 2018 20:05:45 +0530 Subject: [PATCH] Setup for heroku --- server/db/mongoose.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/db/mongoose.js b/server/db/mongoose.js index ea9fe1c..82a0e94 100644 --- a/server/db/mongoose.js +++ b/server/db/mongoose.js @@ -1,6 +1,7 @@ const mongoose = require('mongoose'); mongoose.Promise = global.Promise; -mongoose.connect('mongodb://localhost:27017/TodoApp', { useNewUrlParser: true }); + +mongoose.connect(process.env.MONGODB_URI || 'mongodb://localhost:27017/TodoApp', { useNewUrlParser: true }); module.exports = { mongoose }; \ No newline at end of file