How to get baseUrl in Nuxt?

Diolor Source

This is a reliable way to get the host url in both SSR and CSR:

let host = context.req ? : window.location.origin

But where to put this so all compoments can access the host? It should be loaded once per page and work with both SSR and CSR.



comments powered by Disqus