1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
import { z } from "zod"; import { procedure, router } from "../trpc"; export const appRouter = router({ hello: procedure .input( z.object({ text: z.string(), }), ) .query((opts) => { return { greeting: `hello ${opts.input.text}`, }; }), }); // export type definition of API export type AppRouter = typeof appRouter;