mirror of
https://github.com/rjNemo/meal_planner
synced 2026-06-11 04:46:39 +00:00
19 lines
410 B
TypeScript
19 lines
410 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"}`,
|
|
};
|
|
}),
|
|
});
|
|
|
|
// export type definition of API
|
|
export type AppRouter = typeof appRouter;
|