mirror of
https://gitlab.massbug.com/massbug/judge4c.git
synced 2025-07-04 17:51:18 +00:00
build(api): setup Hono base route handler
This commit is contained in:
parent
66deafc4fb
commit
0b624f0873
@ -1,10 +1,17 @@
|
|||||||
import { Hono } from "hono";
|
import { Hono } from "hono";
|
||||||
import { handle } from "hono/vercel";
|
import { handle } from "hono/vercel";
|
||||||
|
import auth from "@/features/auth/server/route";
|
||||||
|
|
||||||
const app = new Hono().basePath("/api");
|
const app = new Hono().basePath("/api");
|
||||||
|
|
||||||
app.get("/health", (context) => {
|
app.get("/health", (c) => {
|
||||||
return context.json({ status: "ok" });
|
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 GET = handle(app);
|
||||||
|
export const POST = handle(app);
|
||||||
|
|
||||||
|
export type AppType = typeof routes;
|
||||||
|
Loading…
Reference in New Issue
Block a user