diff options
| author | Kumar Damani <kumar.damani@mail.utoronto.ca> | 2019-02-28 17:49:21 +0000 |
|---|---|---|
| committer | Kumar Damani <kumar.damani@mail.utoronto.ca> | 2019-02-28 17:49:21 +0000 |
| commit | 5dd172866ff87842db07e563b3cb77cc3c2577a8 (patch) | |
| tree | e4691429ed02491fba13de2a1e5b5102b19ccd77 /web/app.js | |
| parent | 76214c83dc52d4dca6e5043fe374da57a54f9738 (diff) | |
| parent | 9764fba35cdac7e226dad65f061c09fd3d9909cc (diff) | |
merged feat7 into temp
Diffstat (limited to 'web/app.js')
| -rw-r--r-- | web/app.js | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -23,24 +23,24 @@ app.use(express.static(path.join(__dirname, 'public'))); var env = process.env.NODE_ENV || 'development'; var uri; if (env === 'development') { - uri = 'mongodb://localhost:27017/helpthehome' - // use for small testing only if really necessary - // uri = 'mongodb+srv://development:dreamteam@cluster0-krnr4.mongodb.net/helpthehome?retryWrites=true' + uri = 'mongodb://localhost:27017/helpthehome' + // use for small testing only if really necessary + // uri = 'mongodb+srv://development:dreamteam@cluster0-krnr4.mongodb.net/helpthehome?retryWrites=true' } else if (env === 'qa') { - uri = process.env.MONGODB_URI + uri = process.env.MONGODB_URI } else if (env === 'production') { - uri = '' + uri = '' } // Mongoose connection to MongoDB mongoose.connect(uri, { useNewUrlParser: true }, function (error) { - if (error) { - console.log(error); - console.log("App was not able to connect to the mongo server!"); - console.log("... double check that the mongo server is running locally"); - } else { - console.log(`connected to ${uri}`); - } + if (error) { + console.log(error); + console.log("App was not able to connect to the mongo server!"); + console.log("... double check that the mongo server is running locally"); + } else { + console.log(`connected to ${uri}`); + } }); app.use('/', indexRouter); |
