minor refactors to the adapter code

This commit is contained in:
2026-02-09 00:55:48 +05:30
parent 624b4d35e0
commit 4927be7206
7 changed files with 193 additions and 75 deletions

View File

@@ -1,25 +1,17 @@
import { createFileRoute } from "@tanstack/react-router";
import { config } from "@/bknd";
import config from "../../bknd.config";
// Works fine
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;
},
ANY: async ({ request }) => await handler(request),
},
},
});