title: how do I get round CORS in angular 9
body: <p>I receive the following error:</p>
  
  <pre><code>Access to XMLHttpRequest at 'http://localhost:40000/api/summaryCount/failed-requests' from origin
  'http://localhost:3000' has been blocked by CORS policy: 
  Response to preflight request doesn't pass access control check: 
  No 'Access-Control-Allow-Origin' header is present on the requested resource.
  </code></pre>
  
  <p>I have created a proxy.conf.json file with the following:</p>
  
  <pre><code>{"/api/*": {
      "target": "http://localhost:40000",
      "secure": false
    }
  }
  </code></pre>
  
  <p>I have also amended my angular.json file to include </p>
  
  <pre><code>"proxyConfig": "proxy.conf.json"
  </code></pre>
  
  <p>on the "serve": { "options" { ......</p>
  
  <p>and finally I have amended my package.json  so that the "start" option now becomes:</p>
  
  <pre><code>"start": "ng serve --proxy-config proxy.conf.json",
  </code></pre>
  
  <p>in my Angular when creating the HttpHeaders object, if I add the following:</p>
  
  <pre><code>httpHeaders = new HttpHeaders().append('Access-Control-Allow-Origin', 'http://localhost:3000').....
  </code></pre>
  
  <p>it still makes no difference.</p>
  
  <p>can someone tell me what I've missed please.</p>