Add error handling

This commit is contained in:
KMKoushik
2024-04-22 14:10:34 +10:00
parent 493e9fb63a
commit 66732d2345
6 changed files with 165 additions and 5 deletions

View File

@@ -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",