File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,8 +16,9 @@ import { showRoutes } from "hono/dev";
1616import { resourceFromAttributes } from "@opentelemetry/resources" ;
1717import { ATTR_DEPLOYMENT_ENVIRONMENT_NAME } from "@opentelemetry/semantic-conventions/incubating" ;
1818import { Scalar } from "@scalar/hono-api-reference" ;
19- import { serveStatic } from "hono/bun" ;
2019import { 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" } ;
2122import { requestId } from "hono/request-id" ;
2223import { env } from "./env" ;
2324import { 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
199204app . get (
200205 "/openapi" ,
You can’t perform that action at this time.
0 commit comments