-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
28 lines (21 loc) · 770 Bytes
/
index.ts
File metadata and controls
28 lines (21 loc) · 770 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { swaggerUI } from "@hono/swagger-ui";
import { OpenAPIHono, z } from "@hono/zod-openapi";
// import service from "./config/service.json";
// import model from "./config/model.json";
import { quickSearchRoute } from "./routes/quick-search";
import { modelRoute } from "./routes/model";
import { queryResultsRoute } from "./routes/query-results";
const app = new OpenAPIHono();
app.route("/service", quickSearchRoute);
app.route("/service", modelRoute);
app.route("/service", queryResultsRoute);
// The OpenAPI documentation will be available at /doc
app.doc("/doc", {
openapi: "3.0.0",
info: {
version: "1.0.0",
title: "My API",
},
});
app.get("/ui", swaggerUI({ url: "/doc" })); // '/doc' is the URL of your OpenAPI JSON
export default app;