const express = require('express'),
      mongoose = require('mongoose'),
      bodyParser = require('body-parser'),
      expressValidator = require('express-validator');

const port = process.env.PORT || 8008;
const app = express();

mongoose.Promise = global.Promise;
mongoose.connect('mongodb://localhost/bookroomAPI', (err) => {
  if(err) throw err;
});

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.use(expressValidator());

app.use((req, res, next) => {
  res.header("Access-Control-Allow-Origin", "*");
  res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
  next();
});

app.get('/', (req, res) => res.send('Welcome to the "BOOK ROOM" API'));

require('./server/authRouter')(app, passport);
const roomRouter = require('./server/roomRouter');
app.use('/api/rooms', roomRouter);

const meetingRouter = require('./server/meetingRouter');
app.use('/api/meetings', meetingRouter);

const bookingRouter = require('./server/bookingRouter');
app.use('/api/bookings', bookingRouter);

app.listen(port, () => console.log(`Server running on PORT: ${port}`));

@@ -7,16 +7,25 @@
 express 
+         
 = requir
@@ -53,16 +53,24 @@
 ongoose 
+        
 = requir
@@ -101,16 +101,22 @@
 yParser 
+      
 = requir
@@ -129,24 +129,68 @@
 y-parser'),%0A
+      morgan           = require('morgan'),%0A
       expres
@@ -230,16 +230,115 @@
 idator')
+,%0A      passport         = require('passport'),%0A      session          = require('express-session')
 ;%0A%0Aconst
@@ -515,24 +515,48 @@
 w err;%0A%7D);%0A%0A
+app.use(morgan('dev'));%0A
 app.use(body
@@ -649,24 +649,173 @@
 idator());%0A%0A
+app.use(session(%7B secret: 'wannalookorbook', resave: true, saveUninitialized: true %7D))%0Aapp.use(passport.initialize());%0Aapp.use(passport.session());%0A%0A
 app.use((req
@@ -1066,16 +1066,122 @@
 PI'));%0A%0A
+require('./server/passport/local-signup')(passport);%0Arequire('./server/passport/local-login')(passport);%0A%0A
 require(
@@ -1219,16 +1219,17 @@
 sport);%0A
+%0A
 const ro

include libs and strategies into the server config