From 0b624f0873b4a53dc44dbfe9a00a308846716c11 Mon Sep 17 00:00:00 2001 From: ngc2207 Date: Fri, 31 Jan 2025 16:37:08 +0800 Subject: [PATCH] build(api): setup Hono base route handler --- src/app/api/[[...route]]/route.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/app/api/[[...route]]/route.ts b/src/app/api/[[...route]]/route.ts index 9f3733f..c77ed7d 100644 --- a/src/app/api/[[...route]]/route.ts +++ b/src/app/api/[[...route]]/route.ts @@ -1,10 +1,17 @@ import { Hono } from "hono"; import { handle } from "hono/vercel"; +import auth from "@/features/auth/server/route"; const app = new Hono().basePath("/api"); -app.get("/health", (context) => { - return context.json({ status: "ok" }); +app.get("/health", (c) => { + return c.json({ status: "ok" }); }); +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const routes = app.route("/auth", auth); + export const GET = handle(app); +export const POST = handle(app); + +export type AppType = typeof routes;