1import { postRouter } from "~/server/api/routers/post";
2import { createCallerFactory, createTRPCRouter } from "~/server/api/trpc";
3import { authRouter } from "./routers/auth";
4import { gameRouter } from "./routers/game";
5
6/**
7 * This is the primary router for your server.
8 *
9 * All routers added in /api/routers should be manually added here.
10 */
11export const appRouter = createTRPCRouter({
12 auth: authRouter,
13 game: gameRouter,
14});
15
16// export type definition of API
17export type AppRouter = typeof appRouter;
18
19/**
20 * Create a server-side caller for the tRPC API.
21 * @example
22 * const trpc = createCaller(createContext);
23 * const res = await trpc.post.all();
24 * ^? Post[]
25 */
26export const createCaller = createCallerFactory(appRouter);