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


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



/**
 * 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());

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

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

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

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



@@ -64,22 +64,19 @@
 xpress')
-;%0Avar 
+,%0A%09
 app%09    
@@ -91,22 +91,19 @@
 xpress()
-;%0Avar 
+,%0A%09
 bodyPars
@@ -133,22 +133,19 @@
 parser')
-;%0Avar 
+,%0A%09
 methodOv
@@ -179,22 +179,19 @@
 erride')
-;%0Avar 
+,%0A%09
 path  %09%09
@@ -214,15 +214,12 @@
 th')
-;%09%0Avar 
+,%09%0A%09
 cook
@@ -255,22 +255,19 @@
 parser')
-;%0Avar 
+,%0A%09
 session 
@@ -298,22 +298,19 @@
 ession')
-;%0Avar 
+,%0A%09
 RedisSto
@@ -351,22 +351,19 @@
 session)
-;%0Avar 
+,%0A%09
 passport
@@ -388,22 +388,19 @@
 ssport')
-;%0Avar 
+,%0A%09
 logger %09
@@ -425,22 +425,19 @@
 morgan')
-;%0Avar 
+,%0A%09
 errorHan
@@ -468,16 +468,60 @@
 andler')
+,%0A%09flash          = require('connect-flash')
 ;%0A%0A%0A/**%0A
@@ -549,16 +549,20 @@
 exRoute 
+%09   
 = requir
@@ -589,13 +589,13 @@
 te')
-;%0Avar
+,%0A   
  con
@@ -639,18 +639,16 @@
 ort');%0A%0A
-%0A%0A
 /**%0A * M
@@ -1221,16 +1221,34 @@
 sion());
+%0Aapp.use(flash());
 %0A%0AindexR
@@ -1588,12 +1588,13 @@
 t'));%0A%7D);%0A%0A%0A
+%0A

update app.js