is it "ideal" to directly fetch /api/trpc/route.procedure in another server
im wanting to use my create-t3-app app as main source of data for a different server, and for this i need to access data from the trpc server on the the other server, is it a good idea to just fetch (for example)
http://localhost:3000/api/trpc/route.exampleProcedure
in this other server
the procedure is public anyway so handling request authentication doesnt need to be done4 Replies
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.
Is this what your looking for?
If you can put both servers in a monorepo and they each use typescript you can use a trpc client from your other server.
If you need end points that are only REST and you need many end points, trpc is probably not a good choice. Trpc openapi is good for cases where you need a mostly trpc backend with a few endpoints exposed via REST. if you need only REST and you are not using the trpc client, then using trpc doesn’t really serve any purpose.
Really depends what you’re trying to do
so im using trpc alot for the actual web app, but im wanting to have some data accessible for the web app and also a game server, so i think openapi will be perfect here