fearlessslug
fearlessslug14mo ago

Is it possible to dynamically change the url of httpBatchLink in runtime?

I need to do it because I have 2 domians that share the same NextJS project and I need to be able to point tRPC to the right domain depending on the one the user is currently browsing from
4 Replies
AutumnLight
AutumnLight14mo ago
Im a trpc noob but cant you just host both of them on different ports? also are the code bases of both projects merged or seperate? and is the backend combined or seperated? @FearlessSlug
fearlessslug
fearlessslug14mo ago
Everything is combined, I do mild changes between each website which I'm currently detecting by the hostname in the 13.4 api routes
AutumnLight
AutumnLight14mo ago
@FearlessSlug wait so both backends are also combined? are there some shared backend methods if not what you could do is have a prefix like /page 1 everything /page 2 everything it would be liek /myWebsite/users/create and /yourwebsite/users/create but tbh id seperate both apps
fearlessslug
fearlessslug14mo ago
Thanks that's probably gonna work