fixing things

This commit is contained in:
Michael Freno
2026-01-07 16:50:10 -05:00
parent 0a0c0e313e
commit 5b0f6dba0f
7 changed files with 123 additions and 48 deletions

View File

@@ -9,7 +9,8 @@ import { blogRouter } from "./routers/blog";
import { gitActivityRouter } from "./routers/git-activity";
import { postHistoryRouter } from "./routers/post-history";
import { infillRouter } from "./routers/infill";
import { createTRPCRouter } from "./utils";
import { createTRPCRouter, createTRPCContext } from "./utils";
import type { H3Event } from "h3";
export const appRouter = createTRPCRouter({
auth: authRouter,
@@ -26,3 +27,13 @@ export const appRouter = createTRPCRouter({
});
export type AppRouter = typeof appRouter;
/**
* Create a server-side caller for tRPC procedures
* This allows calling tRPC procedures directly on the server with proper context
*/
export const createCaller = async (event: H3Event) => {
const apiEvent = { nativeEvent: event, request: event.node.req } as any;
const ctx = await createTRPCContext(apiEvent);
return appRouter.createCaller(ctx);
};