title: ExpressJS: Request has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource
body: <p>In my browser developer toolbar I get the following error message for a POST request:</p>
  
  <pre><code>Access to XMLHttpRequest at 'http://localhost:8000/api/tags/' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
  </code></pre>
  
  <p>However when I look into my server.js I do allow access:</p>
  
  <pre><code>app.prepare().then(() =&gt; {
      const server = express();
  
      server.use(function(req, res, next) {
          res.header("Access-Control-Allow-Origin", "*");
          res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
          next();
      });
  </code></pre>
  
  <p>Does anyone know why this is blocked now</p>