'use strict';

var express = require('express');
var routes = require('./app/routes/index.js');
var mongoose = require('mongoose');
var passport = require('passport');
var session = require('express-session');

var app = express();
require('dotenv').load();
require('./app/config/passport')(passport);

mongoose.connect(process.env.MONGO_URI);

app.use('/controllers', express.static(process.cwd() + '/app/controllers'));
app.use('/public', express.static(process.cwd() + '/public'));
app.use('/common', express.static(process.cwd() + '/app/common'));

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

app.use(passport.initialize());
app.use(passport.session());

routes(app, passport);

var port = process.env.PORT || 8080;
app.listen(port,  function () {
	console.log('Node.js listening on port ' + port + '...');
});
@@ -93,80 +93,8 @@
 ');%0A
-var mongoose = require('mongoose');%0Avar passport = require('passport');%0A
 var 
@@ -182,94 +182,8 @@
 d();
-%0Arequire('./app/config/passport')(passport);%0A%0Amongoose.connect(process.env.MONGO_URI);
 %0A%0Aap
@@ -384,24 +384,26 @@
 common'));%0A%0A
+/*
 app.use(sess
@@ -486,70 +486,11 @@
 %7D));
-%0A%0Aapp.use(passport.initialize());%0Aapp.use(passport.session());
+*/%0A
 %0A%0Aro
@@ -501,18 +501,8 @@
 (app
-, passport
 );%0A%0A

remove mongoose, passport, and express-session