mirror of
https://github.com/shishantbiswas/bknd-examples.git
synced 2026-03-01 04:31:16 +00:00
initial commit
This commit is contained in:
25
src/routes/api.$.ts
Normal file
25
src/routes/api.$.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import { config } from "@/bknd";
|
||||
import { serve } from "bknd/adapter/nextjs";
|
||||
|
||||
const handler = serve({
|
||||
...config,
|
||||
// cleanRequest: {
|
||||
// depending on what name you used for the catch-all route,
|
||||
// you need to change this to clean it from the request.
|
||||
// searchParams: ["$"],
|
||||
// },
|
||||
});
|
||||
|
||||
export const Route = createFileRoute("/api/$")({
|
||||
server: {
|
||||
handlers: {
|
||||
ANY: async ({ request }) => {
|
||||
const res = await handler(request);
|
||||
// console.log("[API] ", res);
|
||||
|
||||
return res;
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user