/**
 * Modules Dependencies
 */
var 	express        = require('express'),
	app	       = express(),	
	bodyParser     = require('body-parser'),
	methodOverride = require('method-override'),
	path 	       = require('path'),
	cookieParser   = require('cookie-parser'),
	session        = require('express-session'),
	RedisStore     = require('connect-redis')(session),
	passport       = require('passport'),
	logger         = require('morgan'),
	errorHandler   = require('errorhandler'),
	flash          = require('connect-flash'),
	http 	       = require('http').Server(app),
 	io 	       = require('socket.io')(http);	


/**
 * Routes
 */
var indexRoute 	   = require('./routes/indexRoute'),
    configPassport = require('./config/passport'),
    tweet          = require('./controllers/tweetController');

/**
 * Middlewares
 */
// config Port
app.set('port', process.env.PORT || 3000);

// the directory where the template files are located.
app.set('views', './views');

// the template engine to use.
app.set('view engine', 'jade');

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({
	extended: true
}));
app.use(methodOverride());
app.use(cookieParser());
app.use(session({
	store: new RedisStore(),
	secret: 'keyboard cat',
	saveUninitialized: true,
	resave: false
}));

// use passport middleware
app.use(passport.initialize());
app.use(passport.session());
app.use(flash());

indexRoute(app, passport);
configPassport(passport);
tweet(io);

app.use(express.static(path.join(__dirname, 'public')));
app.use(logger('dev'));

// error handling
if ('development' == app.get('env')) {
	app.use(errorHandler());
}

// Server
http.listen(app.get('port'), function() {
	console.log('Express server listening on port ' + app.get('port'));
});


@@ -29,17 +29,16 @@
  */%0Avar 
-%09
 express 
@@ -66,17 +66,20 @@
 ress'),%0A
-%09
+    
 app%09    
@@ -81,16 +81,20 @@
 %09       
+%09   
 = expres
@@ -99,17 +99,20 @@
 ess(),%09%0A
-%09
+    
 bodyPars
@@ -144,17 +144,20 @@
 rser'),%0A
-%09
+    
 methodOv
@@ -193,17 +193,20 @@
 ride'),%0A
-%09
+    
 path %09  
@@ -202,28 +202,24 @@
    path %09   
-    
 = require('p
@@ -225,17 +225,20 @@
 path'),%0A
-%09
+    
 cookiePa
@@ -272,17 +272,20 @@
 rser'),%0A
-%09
+    
 session 
@@ -321,17 +321,20 @@
 sion'),%0A
-%09
+    
 RedisSto
@@ -377,17 +377,20 @@
 ssion),%0A
-%09
+    
 passport
@@ -419,17 +419,20 @@
 port'),%0A
-%09
+    
 logger  
@@ -459,17 +459,20 @@
 rgan'),%0A
-%09
+    
 errorHan
@@ -505,17 +505,20 @@
 dler'),%0A
-%09
+    
 flash   
@@ -552,17 +552,20 @@
 lash'),%0A
-%09
+    
 http %09  
@@ -561,28 +561,24 @@
    http %09   
-    
 = require('h
@@ -601,17 +601,19 @@
 ),%0A 
-%09
+   
 io %09   
- 
+%09
    =

Update app.js