summaryrefslogtreecommitdiff
path: root/src/index.ts
diff options
context:
space:
mode:
authorseth <[email protected]>2024-07-31 17:03:15 -0400
committerseth <[email protected]>2024-07-31 17:03:15 -0400
commitc676c82b55dbcf052987878ba39d40a5c325e16a (patch)
treed54e1b3a2461cd17c57c0e7ff3cd208e4a99f26b /src/index.ts
parentd43240003212e9a5b92b936d9a0b90adfb41bdcb (diff)
add swagger ui
Diffstat (limited to 'src/index.ts')
-rw-r--r--src/index.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/index.ts b/src/index.ts
index 9f2703b..4de8e6d 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1,5 +1,6 @@
import { logger } from "hono/logger";
import { prettyJSON } from "hono/pretty-json";
+import { swaggerUI } from "@hono/swagger-ui";
import { OpenAPIHono, createRoute } from "@hono/zod-openapi";
import { VERSION } from "./consts";
import { Bindings, Variables } from "./env";
@@ -19,6 +20,8 @@ app.get("/", (c) =>
c.redirect(c.env.REDIRECT_ROOT ?? "https://github.com/getchoo/teawieAPI"),
);
+app.get("/swagger", swaggerUI({ url: "/doc" }));
+
app.doc("/doc", {
openapi: "3.0.0",
info: {