File tree 2 files changed +5
-0
lines changed
2-standard-multiple-api-specs
2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change 1
1
const express = require ( 'express' ) ;
2
2
const path = require ( 'path' ) ;
3
3
const http = require ( 'http' ) ;
4
+ const cookieParser = require ( 'cookie-parser' ) ; // Add if using cookie auth
4
5
const { Pets } = require ( './services' ) ;
5
6
const OpenApiValidator = require ( 'express-openapi-validator' ) ;
6
7
@@ -12,6 +13,7 @@ const apiSpec = path.join(__dirname, 'api.yaml');
12
13
app . use ( express . urlencoded ( { extended : false } ) ) ;
13
14
app . use ( express . text ( ) ) ;
14
15
app . use ( express . json ( ) ) ;
16
+ app . use ( cookieParser ( ) ) ; // Add if using cookie auth enables req.cookies
15
17
16
18
// Optionally serve the API spec
17
19
app . use ( '/spec' , express . static ( apiSpec ) ) ;
Original file line number Diff line number Diff line change 1
1
const express = require ( 'express' ) ;
2
+ const cookieParser = require ( 'cookie-parser' ) ;
2
3
const path = require ( 'path' ) ;
3
4
const http = require ( 'http' ) ;
5
+
4
6
const OpenApiValidator = require ( 'express-openapi-validator' ) ;
5
7
6
8
app = express ( ) ;
7
9
app . use ( express . urlencoded ( { extended : false } ) ) ;
8
10
app . use ( express . text ( ) ) ;
9
11
app . use ( express . json ( ) ) ;
12
+ app . use ( cookieParser ( ) ) ; // add if using cookie auth
10
13
11
14
const versions = [ 1 , 2 ] ;
12
15
You can’t perform that action at this time.
0 commit comments