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

BIN
bun.lockb

Binary file not shown.

View File

@@ -4,6 +4,7 @@
"deploy": "wrangler deploy --minify src/index.ts"
},
"dependencies": {
"@hono/swagger-ui": "^0.2.2",
"@hono/zod-openapi": "^0.12.0",
"gql.tada": "^1.7.4",
"graphql-request": "^7.0.1",

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;