?
This commit is contained in:
parent
52b3444d4d
commit
c43af63c13
2 changed files with 6 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
|||
"use client";
|
||||
|
||||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
||||
import { httpBatchLink } from "@trpc/client";
|
||||
import { httpLink } from "@trpc/client";
|
||||
import React, { useState } from "react";
|
||||
import superjson from "superjson";
|
||||
|
||||
|
@ -12,8 +12,8 @@ export default function Provider({ children }: { children: React.ReactNode }) {
|
|||
const [trpcClient] = useState(() =>
|
||||
trpc.createClient({
|
||||
links: [
|
||||
httpBatchLink({
|
||||
url: "http://localhost:3000/api/trpc",
|
||||
httpLink({
|
||||
url: "/api/trpc",
|
||||
}),
|
||||
],
|
||||
transformer: superjson,
|
||||
|
|
|
@ -12,6 +12,9 @@ const handler = (req: Request) =>
|
|||
req,
|
||||
router: appRouter,
|
||||
createContext: createTRPCContext,
|
||||
batching: {
|
||||
enabled: false,
|
||||
},
|
||||
});
|
||||
|
||||
export { handler as GET, handler as POST };
|
||||
|
|
Loading…
Add table
Reference in a new issue