Great article, thanks. Question, is there way to set the hostname in nuxt.config.js dynamically running with server.js? Example, this would be helpful in case of multiple domains my-host.com and my-host-b.com are pointing to the same nuxt app.
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.
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.
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.
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.
Great article, thanks. Question, is there way to set the hostname in nuxt.config.js dynamically running with server.js? Example, this would be helpful in case of multiple domains my-host.com and my-host-b.com are pointing to the same nuxt app.
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 differentenv
s.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?
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.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.
Have you found a solution? I'm in the same situatien and going crazy here..