@@ -5,13 +5,9 @@ export default(app) => {
55
66 if ( config . swagger . enabled ) {
77
8- // let host = `${config.server.ip}:${config.server.port}`;
9- let host = null ;
10-
118 // swagger definition
129 let swaggerDefinition = {
1310 info : config . swagger . info ,
14- // host: host,
1511 basePath : '/' ,
1612 schemes : [
1713 'http' , 'https'
@@ -29,28 +25,20 @@ export default(app) => {
2925 }
3026 }
3127 } ;
28+
3229 // options for the swagger docs
3330 let options = {
3431 // import swaggerDefinitions
3532 swaggerDefinition : swaggerDefinition ,
3633 // path to the API docs
3734 apis : [ `${ config . base } /**/*.yaml` ]
3835 } ;
36+
3937 // initialize swagger-jsdoc
4038 let swaggerSpec = swaggerJSDoc ( options ) ;
39+
4140 // serve swagger
4241 app . get ( '/swagger.json' , function ( req , res ) {
43- // console.log(req.header('http'));
44- // console.log(req.secure);
45- // console.log(req.header('X-Forwaded-Proto'));
46- // console.log(req.params.pepe);
47- // let host = req.headers.host;
48- // let host = req.headers.host;
49- // console.log(req.get('host'));
50- // console.log(req.headers.origin);
51- // swaggerSpec.host = host;
52- // swaggerSpec.securityDefinitions.iss_a.authorizationUrl =
53- // console.log(swaggerSpec.securityDefinitions.iss_a.authorizationUrl);
5442 res . json ( swaggerSpec ) ;
5543 } ) ;
5644 }
0 commit comments