18 lines
472 B
TypeScript
18 lines
472 B
TypeScript
import {
|
|
createTRPCProxyClient,
|
|
httpBatchLink,
|
|
loggerLink,
|
|
} from '@trpc/client';
|
|
import { AppRouter } from "~/trpc/api/root";
|
|
import { getBaseUrl } from '~/utils/url';
|
|
|
|
|
|
// create the client, export it
|
|
export const api = createTRPCProxyClient<AppRouter>({
|
|
links: [
|
|
// will print out helpful logs when using client
|
|
// loggerLink(),
|
|
// identifies what url will handle trpc requests
|
|
httpBatchLink({ url: `${getBaseUrl()}/api/trpc` })
|
|
],
|
|
}); |