How to setup custom subdomain for multi tenant apps

I have a turborepo that manages a multi-tenant app built with react-vite.

It is setup such that every client will have their custom subdomain in the web url.
ex: tesla.hexacorp.portal, neom.hexacorp.portal

I tried to import the repo in idx, install dependencies and all. It worked, but my api calls goes like : http://5173-idx-portals-fe-turbo-1721200870553.localhost:8000/portals/patient/login/

but it should be http://tesla.localhost:8000/portals/patient/login/

Hope I was able to explain the problem.
Is there any solutions ?

I wonder if this is something that @ksat has thought about and could share some tips around :slight_smile:

Well waiting for the response from @ksat then, really desparate and eager to use IDX. It would be really useful, especially with saving time to setup the projects everytime I change my system.

@kirupa Do you have any solutions for my isssue ?