mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 04:46:05 +00:00
updated nextjs example with app router
This commit is contained in:
12
examples/nextjs/src/app/api/[[...bknd]]/route.ts
Normal file
12
examples/nextjs/src/app/api/[[...bknd]]/route.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { getApp } from "@/bknd";
|
||||
|
||||
const handler = async (request: Request) => {
|
||||
const app = await getApp();
|
||||
return app.fetch(request);
|
||||
};
|
||||
|
||||
export const GET = handler;
|
||||
export const POST = handler;
|
||||
export const PUT = handler;
|
||||
export const PATCH = handler;
|
||||
export const DELETE = handler;
|
||||
Reference in New Issue
Block a user