how can I implement TRPC when my client and server are deployed in separate repositories? #6362
virusxd521
started this conversation in
General
Replies: 1 comment 1 reply
-
|
import { t } from '../trpc.js';
import { adminRouter } from './admin/index.js';
import { coreRouter } from './core/index.js';
export const appRouter = t.router({
admin: adminRouter,
core: coreRouter,
});
export type AppRouter = typeof appRouter;
import type { AppRouter } from '@repo/api/src/procedures/router';
export { AppRouter };
import type { AppRouter } from '@repo/typings';
import { createTRPCReact } from '@trpc/react-query';
export const trpc = createTRPCReact<AppRouter>(); |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to implement TRPC in my React application.
My application is a bit old and using a pretty straight forward React and node.js app and but I'm struggling with integrating TRPC into my application since the FE and the BE are deployed to separate repos and I have a problem to share the Router type.
Any one did something similar and can share? any advice?
Beta Was this translation helpful? Give feedback.
All reactions