File tree 2 files changed +11
-19
lines changed
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);
24
24
require ( './config/socketio' ) ( socketio ) ; < % } % >
25
25
require ( './config/express' ) ( app ) ;
26
26
require ( './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
+
34
28
// Start server
35
29
server . listen ( config . port , config . ip , function ( ) {
36
30
console . log ( 'Express server listening on %d, in %s mode' , config . port , app . get ( 'env' ) ) ;
37
- } ) ; < % } % >
31
+ } ) ;
38
32
39
33
// Expose app
40
34
exports = module . exports = app ;
Original file line number Diff line number Diff line change @@ -33,17 +33,15 @@ module.exports = function(app) {
33
33
app . use ( cookieParser ( ) ) ;
34
34
< % if ( filters . auth ) { % > app . use ( passport . initialize ( ) ) ; < % } % > < % if ( filters . twitterAuth ) { % >
35
35
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
+ < % } % >
47
45
if ( 'production' === env ) {
48
46
app . use ( favicon ( path . join ( config . root , 'public' , 'favicon.ico' ) ) ) ;
49
47
app . use ( express . static ( path . join ( config . root , 'public' ) ) ) ;
You can’t perform that action at this time.
0 commit comments