mirror of
https://github.com/shishantbiswas/bknd-examples.git
synced 2026-03-01 04:31:16 +00:00
minor refactors to the adapter code
This commit is contained in:
@@ -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),
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user