diff options
| author | Fuwn <[email protected]> | 2026-02-03 19:56:19 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-02-03 19:56:37 -0800 |
| commit | 6be34a75cd060444734080ac14d3a33eea630f15 (patch) | |
| tree | beda873457cf5d6f73e97391c902acf8a9b69712 /packages/web/src/server/api/root.ts | |
| parent | feat(iku): Support comment-aware whitespace checking (diff) | |
| download | archived-imemio-6be34a75cd060444734080ac14d3a33eea630f15.tar.xz archived-imemio-6be34a75cd060444734080ac14d3a33eea630f15.zip | |
feat(web): Initialise T3 Stack
Diffstat (limited to 'packages/web/src/server/api/root.ts')
| -rw-r--r-- | packages/web/src/server/api/root.ts | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/packages/web/src/server/api/root.ts b/packages/web/src/server/api/root.ts new file mode 100644 index 0000000..374285c --- /dev/null +++ b/packages/web/src/server/api/root.ts @@ -0,0 +1,23 @@ +import { postRouter } from "~/server/api/routers/post"; +import { createCallerFactory, createTRPCRouter } from "~/server/api/trpc"; + +/** + * This is the primary router for your server. + * + * All routers added in /api/routers should be manually added here. + */ +export const appRouter = createTRPCRouter({ + post: postRouter, +}); + +// 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); |