I have a Node.js React application that outputs different information fetched from an external API depending on the domain provided in the request as a variable.
I'm looking to point hundreds of domains to the application, and need to extract the root domain (that was used to access the app) to then use in the API request.
How can I do this at scale, considering I'll have many domains and can't be editing a vhost file every time?
DNS: domain1.com CNAME domains.example.com
App: Vistor goes to "https://domain1.com/example" -> *var domain = "domain1.com"* -> Customized page output