Skip to content

Commit 6a89c69

Browse files
committed
feat(swagger): host swagger json file
provide endpoint for getting swagger JSON file
1 parent 8e0988f commit 6a89c69

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ app.use(yoga.graphqlEndpoint, yoga);
4444

4545
app.use("/spec", swaggerUi.serve, swaggerUi.setup(swaggerJson));
4646

47+
app.get("/swagger.json", (req, res) => {
48+
res.setHeader("Content-Type", "application/json");
49+
res.send(swaggerJson);
50+
});
51+
4752
RegisterRoutes(app);
4853

4954
// The error handler must be registered before any other error middleware and after all controllers

0 commit comments

Comments
 (0)