Kris
Kris
TTCTheo's Typesafe Cult
Created by Kris on 10/23/2023 in #questions
Server Side Calls with trpc app directory
I'm trying to expose a trpc route to call it with fetch, but I'm obviously doing something wrong. previously we could
const ctx = await createTRPCContext({ req, res });
const caller = appRouter.createCaller(ctx);
const ctx = await createTRPCContext({ req, res });
const caller = appRouter.createCaller(ctx);
but since the app directory release createTRPCContext uses NextRequest. has anyone been able to expose a trpc router in a nextjs api route?
2 replies