crbon
TTCTheo's Typesafe Cult
•Created by crbon on 4/14/2024 in #questions
How can I configure tRPC to function as a REST API (single-route)?
I'm new to tRPC and not sure why this produces an error when an external POST request is sent to the /api/trpc/post.createExternal route.
I'm trying to expose a tRPC route / procedure, so that an external service can POST to it
Example POST
Error on server
Code
post.ts in src/server/api/routers (default create t3 app)
As a side note, I did see https://github.com/jlalmes/trpc-openapi if I want something quick and dirty, should the create-t3-app structure be able to handle it?
Also,
jlalmes/trpc-openapi
doesn't seem to be supported in NextJS 14 with app router
Help would be much appreciated 🙂6 replies