title: Superagent with absolute url prefix
body: <p>I've noticed that I'm writing <code>http://localhost</code> everytime I want to run a node test with <a href="https://www.npmjs.com/package/superagent" rel="nofollow noreferrer">superagent</a>.</p>
  
  <pre><code>import superagent from 'superagent';
  
  const request = superagent.agent();
  request
    .get('http://localhost/whatever')
    .end((err, res) =&gt; { ... });
  </code></pre>
  
  <p>Is there any way of avoiding the <code>localhost</code> part?</p>
  
  <p>As far as I've gone is to avoid the request being hardcoded to the host:</p>
  
  <pre><code>const baseUrl = 'http://localhost:3030';
  
  request
    .get(`${baseUrl}/whatever`)
  </code></pre>
  
  <p>But I still have to carry the <code>baseUrl</code> with the agent everytime.</p>