| 7 | @Hidden() |
| 8 | @Controller("/") |
| 9 | export class IndexController { |
| 10 | @Constant("swagger") |
| 11 | private swagger: SwaggerSettings[]; |
| 12 | |
| 13 | @Get("/") |
| 14 | @View("swagger.ejs") |
| 15 | @(Returns(200, String).ContentType("text/html")) |
| 16 | get(@HeaderParams("x-forwarded-proto") protocol: string, @HeaderParams("host") host: string) { |
| 17 | const hostUrl = `${protocol || "http"}://${host}`; |
| 18 | |
| 19 | return { |
| 20 | BASE_URL: hostUrl, |
| 21 | docs: this.swagger.map((conf) => { |
| 22 | return { |
| 23 | url: hostUrl + conf.path, |
| 24 | ...conf |
| 25 | }; |
| 26 | }) |
| 27 | }; |
| 28 | } |
| 29 | } |
nothing calls this directly
no test coverage detected