title: How to solve the issue response to preflight request doesnt pass access control check error?
body: <p>I have a angular code in a VM, node code in another VM. I need to make an API call from this angular VM to node VM. I have included the cors module also. But still while making an API call, getting an error like </p>
  
  <blockquote>
    <p>"access to xmlhttprequest at 'http:IP1' from origin 'http:IP2' has been blocked by CORS policy: Response to preflight request doesnt pass access control check: No 'Access control".</p>
  </blockquote>
  
  <p>I have set header like this also,</p>
  
  <pre><code>app.use(function(req,res,next) {
      res.setHeader('Access-Control-Allow-Origin','*');
      res.setHeader('Access-Control-Allow-Methods','POST');
      res.setHeader('Access-Control-Allow-Headers','X-Requested-With,content-type');
      res.setHeader('Access-Control-Allow-Credentials',true);
      next();
  }); 
  
  app.use(cors());
  </code></pre>
  
  <p>But still I'm facing an error. Can anybody tell me how to solve this error?</p>