MCPcopy Index your code
hub / github.com/TomDoesTech/REST-API-Tutorial-Updated / swaggerDocs

Function swaggerDocs

src/utils/swagger.ts:34–45  ·  view source on GitHub ↗
(app: Express, port: number)

Source from the content-addressed store, hash-verified

32const swaggerSpec = swaggerJsdoc(options);
33
34function swaggerDocs(app: Express, port: number) {
35 // Swagger page
36 app.use("/docs", swaggerUi.serve, swaggerUi.setup(swaggerSpec));
37
38 // Docs in JSON format
39 app.get("/docs.json", (req: Request, res: Response) => {
40 res.setHeader("Content-Type", "application/json");
41 res.send(swaggerSpec);
42 });
43
44 log.info(`Docs available at http://localhost:${port}/docs`);
45}
46
47export default swaggerDocs;

Callers 1

app.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected