REST methods (GET/POST/PATCH/DELETE)
One route.ts, one export per method. Bext dispatches on request method; methods you don't export return 405 with no extra wiring. Same file shape as Next.js — drop in a Web-API (req: Request) => Response and you're done.
Tip
When you add a new HTTP verb (e.g. DELETE) to an existing route.ts that only exported GET, bext recompiles the bundle in 1-2 s — but the masquerade-side route-table cache stays stale and returns 405 until you purge: curl -X POST http://127.0.0.1:8444/nginx-cache/purge-site -d '{"host":"..."}' .
Try it
// /api/items/route.ts — one file, four methods.
export async function GET() { return Response.json({ items }); }
export async function POST(req) { /* create */ return new Response(..., { status: 201 }); }
export async function PATCH(req) { /* update */ return Response.json({ item }); }
export async function DELETE(req) { /* remove */ return new Response(null, { status: 204 }); }
// Methods you don't export → bext returns 405 automatically.