Next.js Discord

Discord Forum

Getting the TLD the project is running on

Unanswered
Tamaskan Dog posted this in #help-forum
Open in Discord
Avatar
Tamaskan DogOP
My Next.js 14 project is going to run on multiple domains, and I need to know what TLD I'm dealing with. Since I can't access the full URL on RSC, and envs are not available on next.config.js, is middleware the way to go? Am I running into any caching invalidation using middleware?

1 Reply

Avatar
Sun bear
Can’t you just get the host using the headers api ?