-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathroot.ts
More file actions
33 lines (30 loc) · 1.02 KB
/
root.ts
File metadata and controls
33 lines (30 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { leetcodeRouter } from "~/server/api/routers/leetcode";
import { createCallerFactory, createTRPCRouter } from "~/server/api/trpc";
import { weekRouter } from "./routers/week";
import { problemRouter } from "./routers/problem";
import { profileRouter } from "./routers/profile";
import { leaderboardRouter } from "./routers/leaderboard";
import { resourcesRouter } from "./routers/resource";
/**
* This is the primary router for your server.
*
* All routers added in /api/routers should be manually added here.
*/
export const appRouter = createTRPCRouter({
leetcode: leetcodeRouter,
week: weekRouter,
problem : problemRouter,
profile : profileRouter,
leaderboard: leaderboardRouter,
resource: resourcesRouter,
});
// 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);