Files
mini-loader/packages/cli/src/client/client.ts
Morten Olsen 676a7e09b5 init
2024-01-11 12:47:39 +01:00

23 lines
577 B
TypeScript

import { createTRPCProxyClient, httpBatchLink } from '@trpc/client';
import superjson from 'superjson';
import type { Runtime } from '@morten-olsen/mini-loader-server';
import type { RootRouter } from '@morten-olsen/mini-loader-server';
const createClient = () => {
const client = createTRPCProxyClient<RootRouter>({
transformer: superjson,
links: [
httpBatchLink({
url: 'http://localhost:4500/trpc',
}),
],
});
return client;
};
type Client = ReturnType<typeof createClient>;
export type { Client, Runtime };
export { createClient };