feat: add todo example

This commit is contained in:
Yangshun Tay
2022-10-02 12:35:46 +08:00
parent 06bdab6440
commit 6d212b4561
12 changed files with 428 additions and 74 deletions

View File

@ -1,14 +1,18 @@
// Src/server/router/index.ts
import superjson from 'superjson';
import { createRouter } from './context';
import { exampleRouter } from './example';
import { protectedExampleRouter } from './protected-example-router';
import { todosRouter } from './todos';
import { todosUserRouter } from './todos-user-router';
export const appRouter = createRouter()
.transformer(superjson)
.merge('example.', exampleRouter)
.merge('auth.', protectedExampleRouter);
// All keys should be delimited by a period and end with a period.
// Example routers. Learn more about tRPC routers: https://trpc.io/docs/v9/router
.merge('auth.', protectedExampleRouter)
.merge('todos.', todosRouter)
.merge('todos.user.', todosUserRouter);
// Export type definition of API
export type AppRouter = typeof appRouter;