import { Hono } from "jsr:@hono/hono"; import { cors } from "jsr:@hono/hono/netlify"; import { RegisterController } from "../../src/controllers/register"; import { LoginController } from "../../src/controllers/login"; import { handle } from "hono/netlify"; const app = new Hono().basePath("/api"); app.use( "/api/v1/*", cors({ origin: "*", allowHeaders: ["X-Custom-Header", "Upgrade-Insecure-Requests"], allowMethods: ["POST", "GET", "OPTIONS"], exposeHeaders: ["Content-Length", "X-Kuma-Revision"], maxAge: 600, credentials: true, }), ); app.get("/", (c) => { return c.text("Hello Hono!"); }); app.post("/v1/register", RegisterController); app.post("/v1/login", LoginController); export default handle(app);