Replies: 2 comments 2 replies
-
There are 2 ways you can already do this. First one is you put all your public procedures together in a router, which is exactly what you’re asking for. Second is you could mount 2 tRPC instances with separate prefixes and then use a splitLink on the client to direct requests to them. When you add batching into the mix, the latter becomes preferred since all the routes become comma separated after the prefix. We have an example here https://github.com/trpc/trpc/tree/main/examples/soa |
Beta Was this translation helpful? Give feedback.
-
Hi @jonluca, curious what solution you went with if you don't mind. |
Beta Was this translation helpful? Give feedback.
-
I'm trying to set up smart cloudflare cacheing rules in front of a trpc server.
Is there a clean way to differentiate between public and protected procedures? Or to change the url schema within trpc/server?
Right now all requests will go to something like /api/trpc/model.queryFunction
It would be great if we had control over the url schema so that all query functions that were under the base
t.procedure
had a common url schema, so I could add a simple cacheing rule for all fo them that is way more aggressive / not based on the users cookie/auth.Beta Was this translation helpful? Give feedback.
All reactions