Mateus Silva
Dynamic base href for one app and multiples domains path
Hi.
I'm researching frameworks that meet my requirements.
And the most important one is the ability to handle dynamic base href.
I need to serve the same app on multiple domains.
When clients hire us they will point some url from their domains to us.
It could be anything like
So we have to have a SSR application that will serve the home page on any of those domains.
One instance of the app should handle all of those urls.
The problem is that in all SPA framework (SSR or not) the base href is handled statically, you build your app with that static path and when the app load in the browser it verifies if is in the correct base href, some frameworks don’t do nothing and just break (trying to load resources from root) or reloads the page to the specific statically builted base href.
What is ok if you are in a domain with the statically built base href, but it breaks for all other clients that have a different base href or are in the root.
Another important feature would be dynamically loaded components.
Some clients on their home page can have a carousel and others not, but that I know that vue can do.
I guess that one example of this behavior is shopify, you can point your own domain in many ways and it works.
But as far as I know they don’t use SPA.
Is this possible with Nuxt?
Thanks.
5 replies