Add error handling
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
import { OpenAPIHono } from "@hono/zod-openapi";
|
||||
import { swaggerUI } from "@hono/swagger-ui";
|
||||
import { handleError } from "./api-error";
|
||||
|
||||
export function getApp() {
|
||||
const app = new OpenAPIHono().basePath("/api");
|
||||
|
||||
app.onError(handleError);
|
||||
|
||||
// The OpenAPI documentation will be available at /doc
|
||||
app.doc("/v1/doc", (c) => ({
|
||||
openapi: "3.0.0",
|
||||
|
Reference in New Issue
Block a user