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 🙂3 Replies
native trpc cant
you need openapi for that
GitHub
GitHub - jlalmes/trpc-openapi: OpenAPI support for tRPC 🧩
OpenAPI support for tRPC 🧩. Contribute to jlalmes/trpc-openapi development by creating an account on GitHub.
thanks for the clarification