First Commit Test
This commit is contained in:
20
server/trpc/routers/index.ts
Normal file
20
server/trpc/routers/index.ts
Normal file
@ -0,0 +1,20 @@
|
||||
import { z } from 'zod'
|
||||
import { publicProcedure, router } from '../trpc'
|
||||
|
||||
export const appRouter = router({
|
||||
hello: publicProcedure
|
||||
.input(
|
||||
z.object({
|
||||
text: z.string().nullish()
|
||||
})
|
||||
)
|
||||
.query(({ input }) => {
|
||||
return {
|
||||
greeting: `hello ${input?.text ?? 'world'}`,
|
||||
time: new Date()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
// export type definition of API
|
||||
export type AppRouter = typeof appRouter
|
||||
Reference in New Issue
Block a user