docs: add Swagger UI

Summary:

Test Plan:
This commit is contained in:
2024-05-15 23:00:52 -04:00
parent 5d19c2fb90
commit dd47118f3a
3 changed files with 5 additions and 1 deletions

View File

@@ -1,3 +1,4 @@
import { swaggerUI } from "@hono/swagger-ui";
import { OpenAPIHono } from "@hono/zod-openapi";
const app = new OpenAPIHono();
@@ -14,7 +15,7 @@ app.route(
);
// The OpenAPI documentation will be available at /doc
app.doc("/doc", {
app.doc("/openapi.json", {
openapi: "3.0.0",
info: {
version: "1.0.0",
@@ -22,4 +23,6 @@ app.doc("/doc", {
},
});
app.get("/docs", swaggerUI({ url: "/openapi.json" }));
export default app;