mirror of
https://github.com/khairul169/code-share.git
synced 2025-06-17 17:19:34 +07:00
20 lines
375 B
TypeScript
20 lines
375 B
TypeScript
|
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;
|