Next.js Discord

Discord Forum

next(app router) + hono

Unanswered
astro posted this in #help-forum
Open in Discord
how to setup hono with nextjs app router?

/api/[[...route]]/route.ts
import { Hono } from "hono";
import { handle } from "@hono/node-server/vercel";

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

app.get("/hello", (c) => {
  return c.json({
    message: "Hello!",
  });
});

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

0 Replies