Sönke
Sönke5mo ago

Is it possible to change how TRPC maps routers to URL paths?

Hello there, in my current project I would like to map merged routers to subpaths in the url. For example, there is one router to handle auth-related api calls and another one for project settings. At the moment, when I merge both routers into a "root" router, the procedures are available under e.g. /auth.signup or /project.create. This is perfectly fine until I merge two routers that each merge more routers. Then it becomes e.g. /auth.signup.verify. As I am building an API that should be usable by external users (not only my own frontend), I would prefer it to be /auth/signup.verify to prevent confusion. Is there an option to achieve this result?
Solution:
I noticed that this would make batching unusable and therefore expect it not to be possible.
Jump to solution
1 Reply
Solution
Sönke
Sönke5mo ago
I noticed that this would make batching unusable and therefore expect it not to be possible.