You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
459 B
TypeScript

import { createTRPCProxyClient, httpBatchLink } from '@trpc/client';
import type { AppRouter } from '../../server/src/index';
export const trpc = createTRPCProxyClient<AppRouter>({
links: [
httpBatchLink({
// `import.meta.env` is what Vite uses to expose envvars:
url: import.meta.env.VITE_SERVER_BASE_URL || 'https://calendar-optimizer-server.sakal.us',
}),
],
transformer: {
serialize: (x)=>x,
deserialize: (x)=>x,
}
});