tRPCttRPC
Powered by
xeon06X
tRPC•4y ago•
1 reply
xeon06

Using `fetchRequestHandler` with other routes?

Hey everyone, I'm trying to use the
fetchRequestHandler
fetchRequestHandler
with a HatTip server, but all the examples seem to give tRPC entire control of all server responses. I actually want to serve other things besides tRPC routes. Anyone know how I could go about this?

So far I've tried this, as well as changing the
endpoint
endpoint
to
"/"
"/"
and
""
""
. Always the same result, 404s on /trpc

app.use("/trpc", ({ request }) =>
  fetchRequestHandler({
    endpoint: "/trpc",
    req: request,
    router: appRouter,
    createContext,
  })
)
app.use("/trpc", ({ request }) =>
  fetchRequestHandler({
    endpoint: "/trpc",
    req: request,
    router: appRouter,
    createContext,
  })
)
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Using tRPC with Expo API Routes feature?
AxatAAxat / ❓-help
3y ago
Set custom header for fetchRequestHandler
typedefTtypedef / ❓-help
3y ago
WebSocket Subscriptions in Next.js 14 Using `fetchRequestHandler` and `createTRPCReact`
Hemant RajputHHemant Rajput / ❓-help
2y ago
Is there a way to catch (and log) TRPC errors using fetchRequestHandler?
Answer OverflowAAnswer Overflow / ❓-help
2y ago