title: ES6 fetch: How do I change the localhost port it calls?
body: <p>I have a webpack-dev-server running with node.js on <code>:8080</code> serving my frontend. I have a Spring Boot MVC application running on <code>:8088</code> serving my actual backend service.</p>
  
  <p>I have a login system I want to call on :8088, how would I change the permanent settings of the <code>fetch</code> function to refer to <code>:8088</code> instead of <code>:8080</code> every time the function is called?</p>
  
  <p>I've tried the following, but to no avail:</p>
  
  <pre><code>login ({commit}, authData) {
        fetch('/api/login', {
          username: authData.username,
          password: authData.password
        }, {
          mode: 'no-cors',
          method: 'post',
          url: `http://localhost:8088`,
          credentials: 'include'
        }) // ... goes on 
  </code></pre>
  
  <p>However, it still refers to 8080:</p>
  
  <pre><code>bodyUsed: false
  headers: Headers {  }
  ok: true
  redirected: false
  status: 200
  statusText: "OK"
  type: "basic"
  url: "http://localhost:8080/api/login"
  </code></pre>