2025-09-11 11:25:10 +10:00

27 lines
765 B
TypeScript

import { postRouter } from "~/server/api/routers/post";
import { createCallerFactory, createTRPCRouter } from "~/server/api/trpc";
import { commandTemplateRouter } from "./routers/commandTemplate";
export const appRouter = createTRPCRouter({
post: postRouter,
commandTemplate: commandTemplateRouter, // <-- ADD THIS LINE
});
/**
* This is the primary router for your server.
*
* All routers added in /api/routers should be manually added here.
*/
// export type definition of API
export type AppRouter = typeof appRouter;
/**
* Create a server-side caller for the tRPC API.
* @example
* const trpc = createCaller(createContext);
* const res = await trpc.post.all();
* ^? Post[]
*/
export const createCaller = createCallerFactory(appRouter);