DEV Community

loading...

Discussion on: Sitemap for dynamic routes in NuxtJS

Collapse
andynoir profile image
Andrey Gaisinskii Author

Hi!

Not quite sure what do you mean, but you can access nuxt config inside your module by this.nuxt.options.sitemap.hostname. Also you can use different envs.

Collapse
djmenkveld profile image
Dirk Menkveld

Hey men, thanks for replying.

Well, the host needs to be dynamic, where I've different data connected to each host.

Example domains:
tourzomer.com
fantaciclo.it
grandtourfantasy.com

All domains are for different purposes and have dynamics path for teams and others. So, in the nuxt config or sitemap config I call call for example teams per domain from my backend. But, in order to do i need to know which domain it is. So, i set a client-host to my call, but for some reason i do not know which domain the app is.

Does this make sense?

Thread Thread
andynoir profile image
Andrey Gaisinskii Author

Still don't get it:)

But maybe you can add a custom header to your API calls. And each of your websites will have a custom header, for e.g. x-platform: tourzomer, x-platform: fantaciclo and so on.

Thread Thread
djmenkveld profile image
Dirk Menkveld

Hi, yeah that's the solution, but the problem is that I can't access the hostname tourzomer or fantaciclo in nuxt config or the utils helper I have to get the routes.