moving to trpc

This commit is contained in:
2024-11-08 08:16:26 -07:00
parent 3f4d665dd2
commit 9503b208d2
18 changed files with 5151 additions and 8235 deletions

View File

@@ -0,0 +1,23 @@
import { createContext } from "../context";
import publicProcedure from "../procedures/public";
import { createCallerFactory, mergeRouters, router } from "../trpc";
export const helloRouter = router({
sayHello: publicProcedure.query(() => {
// runs on the server I think
console.log("hello world router on the server?");
return { greeting: `Hello World!` };
}),
});
export const appRouter = mergeRouters(helloRouter);
export const createCaller = createCallerFactory(appRouter);
export const createAsyncCaller = async () => {
const context = await createContext();
return createCaller(context);
};
export type AppRouter = typeof appRouter;