import { readFile } from "fs/promises"; import path from "path"; import { withApiHandler } from "@/lib/api-handler"; export async function GET(request: Request) { return withApiHandler(request, async () => { const specPath = path.join(process.cwd(), "docs", "api", "openapi.yaml"); const spec = await readFile(specPath, "utf8"); return new Response(spec, { status: 200, headers: { "Content-Type": "application/yaml; charset=utf-8" }, }); }); }