13 lines
386 B
TypeScript
Raw Permalink Normal View History

2024-02-22 12:14:58 +00:00
import { createContext } from "./context";
import { appRouter } from "../../routers/_app";
import { createCallerFactory } from ".";
import { PageContext } from "vike/types";
2024-02-22 12:14:58 +00:00
const trpcServer = async (ctx: PageContext) => {
const createCaller = createCallerFactory(appRouter);
2024-02-23 19:36:10 +07:00
const context = await createContext(ctx);
return createCaller(context);
};
2024-02-22 12:14:58 +00:00
export default trpcServer;