title: CORS issue with Express Server API to Next.js
body: <p>I have a user authentication server setup using Express and Node.js in my localhost Port 3333 and I am trying to connect to the endpoint in Next.js port 3000 using isomorphic-unfetch for the fetch. I am getting a CORS 401 error, I have done a fair bit of research already but just wanted to know whether it was possible connecting to a Express server on localhosts? I have tried adding "Access-Control-Allow-Origin": "*", "Content-Type": "multipart/form-data" to a header object. The express server has cors setup already.</p>
  
  <p>This function below is called on click of a button.</p>
  
  <pre><code>onLoginClick = async () =&gt; {
    let header = new Headers({
      "Access-Control-Allow-Origin": "*",
      "Content-Type": "multipart/form-data"
    });
    const res = await fetch("http://localhost:3333", {
      method: "POST",
      header,
      body: JSON.stringify({
        username: "USER",
        password: "PASSWORD"
      })
    });
  }
  </code></pre>
  
  <p>Error message - </p>
  
  <pre><code>http://localhost:3333/ 401 (Unauthorized)
  Response {type: "cors", url: "http://localhost:3333/", redirected: false, status: 401, ok: false, …}
  </code></pre>