@@ -8,35 +8,41 @@ var passport = require('passport');
8
8
var session = require ( 'express-session' ) ;
9
9
var mongoStore = require ( 'connect-mongo' ) ( session ) ;
10
10
11
- var bodyParser = require ( 'body-parser' )
11
+ var bodyParser = require ( 'body-parser' ) ;
12
12
13
13
require ( './config/passport' ) ( passport ) ;
14
14
var app = express ( ) ;
15
15
16
- app . use ( bodyParser . urlencoded ( { extended : false } ) )
16
+ app . use ( bodyParser . urlencoded ( { extended : false } ) ) ;
17
17
app . use ( bodyParser . json ( ) ) ;
18
18
19
19
mongoose . connect ( process . env . DB_URI ) ;
20
20
21
- app . use ( '/' , express . static ( process . cwd ( ) + '/public' ) ) ;
22
- app . use ( '/' , express . static ( process . cwd ( ) + '/views' ) ) ;
23
- app . use ( '/assets' , express . static ( process . cwd ( ) + '/assets' ) ) ;
24
-
25
- app . use ( session ( {
26
- secret : process . env . SECRET_SESSION || 'superSecureSecret' ,
27
- resave : true ,
21
+ app . use ( '/' , express . static ( process . cwd ( ) + '/public' ) ) ;
22
+ app . use ( '/' , express . static ( process . cwd ( ) + '/views' ) ) ;
23
+ app . use ( '/assets' , express . static ( process . cwd ( ) + '/assets' ) ) ;
24
+
25
+ app . use (
26
+ session ( {
27
+ secret : process . env . SECRET_SESSION || 'superSecureSecret' ,
28
+ resave : true ,
28
29
saveUninitialized : true ,
29
30
store : new mongoStore ( {
30
31
mongooseConnection : mongoose . connection
31
32
} )
32
- } ) ) ;
33
+ } )
34
+ ) ;
33
35
34
36
app . use ( passport . initialize ( ) ) ;
35
37
app . use ( passport . session ( ) ) ;
36
38
39
+ app . get ( '/status/ping' , ( req , res ) => {
40
+ res . send ( { msg : 'pong' } ) . status ( 200 ) ;
41
+ } ) ;
42
+
37
43
routes ( app , passport ) ;
38
44
39
45
const portNum = process . env . PORT || 3000 ;
40
- app . listen ( portNum , function ( ) {
41
- console . log ( 'Node.js listening on port ' + portNum + '...' ) ;
42
- } ) ;
46
+ app . listen ( portNum , function ( ) {
47
+ console . log ( 'Node.js listening on port ' + portNum + '...' ) ;
48
+ } ) ;
0 commit comments