Context
In app/api/[[...slugs]]/route.ts, the Next.js catch-all route handler is used as a proxy to forward incoming HTTP requests to the underlying Elysia application (src/server/app).
Problem
The Next.js route handler only exports the GET method:
export const GET = handler;
Because Next.js strictly requires explicit exports for each supported HTTP method, Next.js will intercept and block any POST, PUT, PATCH, or DELETE requests before they ever reach Elysia, automatically returning a 405 Method Not Allowed.
For a full-stack boilerplate/kit, this fundamentally breaks the ability to create, update, or delete resources through the API.
Recommended Solution
Export all standard HTTP methods from the route handler so Elysia can handle the routing properly for all types of requests.
Example Fix:
export const GET = handler;
export const POST = handler;
export const PUT = handler;
export const PATCH = handler;
export const DELETE = handler;
export const OPTIONS = handler;
Context
In
app/api/[[...slugs]]/route.ts, the Next.js catch-all route handler is used as a proxy to forward incoming HTTP requests to the underlying Elysia application (src/server/app).Problem
The Next.js route handler only exports the
GETmethod:Because Next.js strictly requires explicit exports for each supported HTTP method, Next.js will intercept and block any
POST,PUT,PATCH, orDELETErequests before they ever reach Elysia, automatically returning a405 Method Not Allowed.For a full-stack boilerplate/kit, this fundamentally breaks the ability to create, update, or delete resources through the API.
Recommended Solution
Export all standard HTTP methods from the route handler so Elysia can handle the routing properly for all types of requests.
Example Fix: