@@ -5,13 +5,9 @@ var path = require('path');
5
5
6
6
import bodyParser from 'body-parser' ;
7
7
import expressRequestId from 'express-request-id' ;
8
-
9
- import auth from './apis/auth' ;
10
8
import logger from './libs/logger' ;
9
+ import ping from './apis/ping' ;
11
10
import session from './libs/session' ;
12
- import userMiddleware from './libs/userMiddleware' ;
13
-
14
- const file = 'server/app.js' ;
15
11
16
12
const app = express ( ) ;
17
13
@@ -21,22 +17,7 @@ app.use(session.createSessionMiddleware());
21
17
app . use ( logger ) ;
22
18
app . use ( express . static ( path . join ( __dirname , './public' ) ) ) ;
23
19
24
- app . post ( '/signin' , ( req , res ) => {
25
- req . log . info ( { file, function :'post' , req : { url : req . url } } ) ;
26
-
27
- auth . signin ( req )
28
- . then ( ( result ) => res . send ( result ) )
29
- . catch ( ( error ) => {
30
- req . log . info ( { file, function : 'post' , error } ) ;
31
- res . status ( 403 ) . send ( error ) ;
32
- } ) ;
33
- } ) ;
34
-
35
- app . post ( '/signout' , ( req , res ) => {
36
- req . log . info ( { function :'app.post' , req : { url : req . url } } ) ;
37
-
38
- res . send ( auth . signout ( req , res ) ) ;
39
- } ) ;
20
+ ping ( app ) ;
40
21
41
22
// Export your express server so you can import it in the lambda function.
42
23
module . exports = app ;
0 commit comments