title: How to fix "blocked by CORS policy" when POST request to different port in Angular 7?
body: <p>I'm trying to post request to node server "<a href="http://localhost:3000" rel="nofollow noreferrer">http://localhost:3000</a>" from 
   "<a href="http://localhost:4200" rel="nofollow noreferrer">http://localhost:4200</a>".</p>
  
  <p>//Client Side - Angular 7</p>
  
  <pre><code>  let obs = this.http.post('http://localhost:3000/testpost',
      {
        "data":  "test123"
      }
      );
      obs.subscribe((response)=&gt; console.log(response),
      (error)  =&gt; console.log("Error" ,error)
    );
  </code></pre>
  
  <p>//Server Side - Node Js</p>
  
  <pre><code>app.post('/testpost',function(req,res){
    res.setHeader('Access-Control-Allow-Origin', '*');
    res.json({"responseCode" : 0,"response":req.query['data']});
  });
  </code></pre>
  
  <p>I expect data from server but CORS policy error occurs</p>