From 883ec62c7a9569544bfd915c99665ffa90496398 Mon Sep 17 00:00:00 2001 From: Jack Foltz Date: Wed, 25 Jul 2018 01:42:39 -0400 Subject: [PATCH] Update mongo args for latest version --- config/default.json | 2 +- config/dev.json | 2 +- config/test.json | 2 +- server.js | 5 ++--- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/config/default.json b/config/default.json index 180ad5c..d8e9df4 100644 --- a/config/default.json +++ b/config/default.json @@ -1,3 +1,3 @@ { - "dbHost": "mongodb://localhost/shimapan" + "dbHost": "mongodb://localhost:27017/shimapan" } diff --git a/config/dev.json b/config/dev.json index 180ad5c..d8e9df4 100644 --- a/config/dev.json +++ b/config/dev.json @@ -1,3 +1,3 @@ { - "dbHost": "mongodb://localhost/shimapan" + "dbHost": "mongodb://localhost:27017/shimapan" } diff --git a/config/test.json b/config/test.json index d39e6e2..e3a350d 100644 --- a/config/test.json +++ b/config/test.json @@ -1,3 +1,3 @@ { - "dbHost": "mongodb://localhost/shimapan-test" + "dbHost": "mongodb://localhost:27017/shimapan-test" } \ No newline at end of file diff --git a/server.js b/server.js index 5691691..0af7f8f 100755 --- a/server.js +++ b/server.js @@ -16,7 +16,7 @@ if(config.util.getEnv('NODE_ENV') !== 'test') { } mongoose.Promise = global.Promise; -mongoose.connect(config.dbHost, {useMongoClient: true}); +mongoose.connect(config.dbHost, {useNewUrlParser: true}); const db = mongoose.connection; db.on('error', function(err) { if (err) console.log('MongoDB Connection Error: ', err); @@ -53,7 +53,6 @@ app.use(methodOverride('X-HTTP-Method-Override')); //app.use(favicon(__dirname + '/public/img/favicon.ico')); -console.log(__dirname + '/public'); app.use(express.static(__dirname + '/public')); @@ -63,7 +62,7 @@ require('./config/passport.js'); // Start app const port = process.env.PORT || 8080; -const server = app.listen(port); +var server = app.listen(port); console.log('Listening on port ', port, '...'); // Handle sigint