child router question
let's say we have a monorepo, one server, two client apps (cat and dog). we make one appRouter, like:
export const appRouter = t.router({
cat: catRouter,
dog: dogRouter
})
export type CatRouter = typeof catRouter;
export type DogRouter = typeof dogRouter;
the cat app should only know about cat routes, dog app only about dog routes by importing the right type.
the server will listen for /cat.getCatFood and /dog.getBone. either i want to change the dot to a forward slash so i can simply tell cat app the baseurl is <url>/cat OR tell client, hey, baseUrl is <url> but, you should prefix all calls with "cat."
are either possible?
1 Reply
Not currently possible, and it would break batching if you did it.
There is an open issue/pr to support this but IIRC it stalled