MCPcopy
hub / github.com/tsedio/tsed / IndexController

Class IndexController

tools/integration/src/controllers/pages/IndexController.ts:9–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7@Hidden()
8@Controller("/")
9export 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}

Callers

nothing calls this directly

Calls 5

ConstantFunction · 0.90
GetFunction · 0.90
ReturnsFunction · 0.90
ViewFunction · 0.85
ContentTypeFunction · 0.85

Tested by

no test coverage detected