Skip to content

Commit

Permalink
Merge pull request #75 from airavata-courses/fixes/release-1.0
Browse files Browse the repository at this point in the history
Fix #73 changing db url to static
  • Loading branch information
akshaygpt authored Feb 28, 2020
2 parents 6bf3784 + faad1cc commit 3aae702
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions session-management/server.js
Original file line number Diff line number Diff line change
@@ -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()
Expand All @@ -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!'))
Expand All @@ -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')
})

0 comments on commit 3aae702

Please sign in to comment.