File tree Expand file tree Collapse file tree 2 files changed +11
-19
lines changed Expand file tree Collapse file tree 2 files changed +11
-19
lines changed Original file line number Diff line number Diff line change @@ -24,17 +24,11 @@ var socketio = require('socket.io').listen(server);
2424require ( './config/socketio' ) ( socketio ) ; < % } % >
2525require ( './config/express' ) ( app ) ;
2626require ( './routes' ) ( app ) ;
27- < % if ( filters . twitterAuth ) { % >
28- mongoose . connection . on ( 'connected' , function ( ) {
29- // Start server
30- server . listen ( config . port , config . ip , function ( ) {
31- console . log ( 'Express server listening on %d, in %s mode' , config . port , app . get ( 'env' ) ) ;
32- } ) ;
33- } ) ; < % } else { % >
27+
3428// Start server
3529server . listen ( config . port , config . ip , function ( ) {
3630 console . log ( 'Express server listening on %d, in %s mode' , config . port , app . get ( 'env' ) ) ;
37- } ) ; < % } % >
31+ } ) ;
3832
3933// Expose app
4034exports = module . exports = app ;
Original file line number Diff line number Diff line change @@ -33,17 +33,15 @@ module.exports = function(app) {
3333 app . use ( cookieParser ( ) ) ;
3434 < % if ( filters . auth ) { % > app . use ( passport . initialize ( ) ) ; < % } % > < % if ( filters . twitterAuth ) { % >
3535
36- mongoose . connection . on ( 'connected' , function ( ) {
37- // Persist sessions with mongoStore
38- // We need to enable sessions for passport twitter because its an oauth 1.0 strategy
39- app . use ( session ( {
40- secret : config . secrets . session ,
41- resave : true ,
42- saveUninitialized : true ,
43- store : new mongoStore ( { mongoose_connection : mongoose . connection } )
44- } ) ) ;
45- } ) ; < % } % >
46-
36+ // Persist sessions with mongoStore
37+ // We need to enable sessions for passport twitter because its an oauth 1.0 strategy
38+ app . use ( session ( {
39+ secret : config . secrets . session ,
40+ resave : true ,
41+ saveUninitialized : true ,
42+ store : new mongoStore ( { mongoose_connection : mongoose . connection } )
43+ } ) ) ;
44+ < % } % >
4745 if ( 'production' === env ) {
4846 app . use ( favicon ( path . join ( config . root , 'public' , 'favicon.ico' ) ) ) ;
4947 app . use ( express . static ( path . join ( config . root , 'public' ) ) ) ;
You can’t perform that action at this time.
0 commit comments