import { Hono } from "hono";
import { handle } from "hono/vercel";

import auth from "@/features/auth/server/route";
import tasks from "@/features/tasks/server/route";
import epics from "@/features/epics/server/route";
import boards from "@/features/boards/server/route";
import members from "@/features/members/server/route";
import projects from "@/features/projects/server/route";
import workspaces from "@/features/workspaces/server/route";
import notifications from "@/features/notifications/server/route";

const app = new Hono().basePath("/api");

const routes = app
  .route("/users", auth)
  .route("/members", members)
  .route("/projects", projects)
  .route("/workspaces", workspaces)
  .route("/boards", boards)
  .route("/tasks", tasks)
  .route("/epics", epics)
  .route("/notifications", notifications);

export const GET = handle(app);
export const POST = handle(app);
export const PATCH = handle(app);
export const DELETE = handle(app);

export type AppType = typeof routes;
