Skip to content

Commit f65d77d

Browse files
fix compile bug
1 parent 7a31613 commit f65d77d

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

apps/server/src/index.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ import { showRoutes } from "hono/dev";
1616
import { resourceFromAttributes } from "@opentelemetry/resources";
1717
import { ATTR_DEPLOYMENT_ENVIRONMENT_NAME } from "@opentelemetry/semantic-conventions/incubating";
1818
import { Scalar } from "@scalar/hono-api-reference";
19-
import { serveStatic } from "hono/bun";
2019
import { prettyJSON } from "hono/pretty-json";
20+
import openapiYaml from "../static/openapi.yaml" with { type: "text" };
21+
import openapiV1Json from "../static/openapi-v1.json" with { type: "text" };
2122
import { requestId } from "hono/request-id";
2223
import { env } from "./env";
2324
import { handleError } from "./libs/errors";
@@ -193,8 +194,12 @@ app.get("/ping", (c) => {
193194
);
194195
});
195196

196-
app.get("/openapi.yaml", serveStatic({ path: "./static/openapi.yaml" }));
197-
app.get("/openapi-v1.json", serveStatic({ path: "./static/openapi-v1.json" }));
197+
app.get("/openapi.yaml", (c) => {
198+
return c.text(openapiYaml, 200, { "Content-Type": "application/yaml" });
199+
});
200+
app.get("/openapi-v1.json", (c) => {
201+
return c.json(openapiV1Json, 200);
202+
});
198203

199204
app.get(
200205
"/openapi",

0 commit comments

Comments
 (0)