title: fetch from localhost on same server
body: <p>I'm running both the front-end (React) and back-end (nodejs) on the same linux server.</p>
  
  <p>In my front-end, I have a <code>fetch</code> request to the back-end which I have to specify as <code>fetch('http://10.25.248.238:3001/')</code>, the IP (local because this site is for internal company use) and port of the back-end.</p>
  
  <p>Is there a way to avoid hardcoding this back-end IP address so that it still works if both the front-end and back-end gets moved to another server? </p>
  
  <p>I have tried <code>http://localhost:3001</code> but that actually tries to fetch from the localhost of the visitors of the website. <code>fetch('/')</code> didn't work either.</p>
  
  <p>Registering a domain name is not appropriate as this site is only meant for internal use.</p>