// node dependencies
var express = require('express');

var db = require('./db');
var passport = require('passport');
var morgan = require('morgan');
var parser = require('body-parser');

// custom dependencies
var db = require('../db/Listings.js');
var db = require('../db/Users.js');
var db = require('../db/Categories.js');

// use middleware
server.use(session({
  secret: 'hackyhackifiers',
  resave: false,
  saveUninitialized: true
}));
server.use(passport.initialize());
server.use(passport.session());

// Router


var app = express();

// configure passport
// passport.use(new LocalStrategy(User.authenticate()));
// passport.serializeUser(User.serializeUser());
// passport.deserializeUser(User.deserializeUser());

// Set what we are listening on.
app.set('port', 3000);

// Logging and parsing
app.use(morgan('dev'));
app.use(parser.json());

// Set up and use our routes
// app.use('/', router);
// var router = require('./routes.js');
// Serve the client files

app.use(express.static(__dirname + '/../client'));

// If we are being run directly, run the server.
if (!module.parent) {
  app.listen(app.get('port'));
  console.log('Listening on', app.get('port'));
}

module.exports.app = app;

@@ -48,23 +48,27 @@
 ress');%0A
-%0A
 var 
-db
+session
  = requi
@@ -71,20 +71,31 @@
 equire('
-./db
+express-session
 ');%0Avar 
@@ -219,32 +219,68 @@
 dencies%0Avar db =
+ require('../db/db.js');%0A// var db =
  require('../db/
@@ -286,32 +286,35 @@
 /Listings.js');%0A
+// 
 var db = require
@@ -329,24 +329,27 @@
 Users.js');%0A
+// 
 var db = req
@@ -378,16 +378,38 @@
 .js');%0A%0A
+var app = express();%0A%0A
 // use m
@@ -418,22 +418,19 @@
 dleware%0A
-server
+app
 .use(ses
@@ -509,30 +509,27 @@
 : true%0A%7D));%0A
-server
+app
 .use(passpor
@@ -545,22 +545,19 @@
 ize());%0A
-server
+app
 .use(pas
@@ -587,38 +587,16 @@
 outer%0A%0A%0A
-var app = express();%0A%0A
 // confi

Fix db-connect commit (to working server state!)