How can I get the URL address from the browser in ReactJS (servers URL)
<p>I can parse are HTTP response of one of the intial calls and save that in the state but there must be another way to get the URL?</p>

<p>I am using the npm 'rest' library and want to specify a different port but I do not know the path on which machine the server will be installed so I need the server's url.</p>

<p><strong>Solution</strong></p>

<p>window.location.hostname</p>