var express = require('express');
var morgan = require('morgan');
var mongoose = require('mongoose');
var methodOverride = require('method-override');
var bodyParser = require('body-parser');
var cookieParser = require('cookie-parser');
var session = require('express-session');
//var config = require('./../config/pass');
var database = require('./database');
var routes = require('./../app/routes');

// mount an instance of express router on the routes
var router = express.Router();
routes(router);

var app = express();

// connect to the database
mongoose.connect(database.db);


app.use(session({
  secret: 'I love andela',
  resave: false,
  saveUninitialized: true,
}));

app.use(methodOverride('X-HTTP-Method-Override'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(morgan('dev'));

// mount the router on the root directory
app.use('/', router);


module.exports = app;

@@ -497,16 +497,61 @@
 uter);%0A%0A
+// instantiate an object instance of express%0A
 var app 
@@ -623,17 +623,44 @@
 e.db);%0A%0A
+app.use(bodyParser.json());
 %0A
-
 app.use(
@@ -813,32 +813,66 @@
 bodyParser.json(
+%7Btype: 'application/vnd.api+json'%7D
 ));%0Aapp.use(body
@@ -901,20 +901,19 @@
 tended: 
-fals
+tru
 e %7D));%0Aa
@@ -1003,16 +1003,77 @@
 rectory%0A
+app.get('/', function(req, res)%7B%0A%09res.send('I am here');%0A%7D);%0A
 app.use(
@@ -1074,16 +1074,19 @@
 p.use('/
+api
 ', route

add body parser format for json api