From faad1cca83713ee2e8a869651a855afe8bb217b5 Mon Sep 17 00:00:00 2001 From: akshaygpt Date: Thu, 27 Feb 2020 23:38:25 -0500 Subject: [PATCH] Fix #73 changing db url to static --- session-management/server.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/session-management/server.js b/session-management/server.js index 286ae7c..8e7bd15 100644 --- a/session-management/server.js +++ b/session-management/server.js @@ -1,4 +1,4 @@ -require('dotenv').config() //load all environment variables from .env +//require('dotenv').config() //load all environment variables from .env const express = require('express') const bodyParser = require('body-parser') //middleware for reading html from node const app = express() @@ -7,7 +7,7 @@ const usersRouter = require('./routes/users') // const historiesRouter = require('./routes/histories') //db connection -mongoose.connect(process.env.DATABASE_URL, {useNewUrlParser: true}) +mongoose.connect('mongodb://localhost:27017/ads-project', {useNewUrlParser: true}) const db = mongoose.connection db.on('error', err => console.log(err)) db.once('open', () => console.log('Connected to database!')) @@ -25,6 +25,6 @@ app.use('/users', usersRouter) //anything with the route 'root/users/anything/he // app.use('/histories', historiesRouter) //handlers -app.listen(process.env.PORT || 4321, function() { +app.listen(4321, function() { console.log('Server started on port 4321') }) \ No newline at end of file