mirror of
https://github.com/morten-olsen/mini-loader.git
synced 2026-02-08 01:36:26 +01:00
init
This commit is contained in:
22
packages/cli/src/client/client.ts
Normal file
22
packages/cli/src/client/client.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
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 };
|
||||
Reference in New Issue
Block a user