Get domain via Node / Vue.js

0

I simply want the domain that appears there in the URL to appear on the page.

window.location.hostname gives me this, it just does not work on Node / Vue.js, so what would be the solution?

    
asked by anonymous 17.08.2018 / 16:26

1 answer

2

I do not understand your question, even because it is not clear enough. But to get the domain you can use a Javascript property that returns the domain of the page.

document.domain

When executing this in the console of so you will have the following return:

"pt.stackoverflow.com"

For more information you can access this documentation by clicking here . p>     

17.08.2018 / 16:33