Files
WebAdmin3.0/server/trpc/routers/index.ts
2023-04-11 15:08:56 +02:00

21 lines
427 B
TypeScript

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