title: How to resolve the CORS issue using proxy in angular
body: <p>I am using express Node backend and frontend for angular. the thing is when i was integrate my API to angular i had CORS problem. inside the developer console i have got a error like this "XmlHttpRequet cannot load <a href="http://localhost:3000/student" rel="nofollow noreferrer">http://localhost:3000/student</a> No Access-Control-Allow-Origin"</p>
  
  <p>I have tried to proxy the backend adding a proxy-confg.json inside the angular project. but the result also same. still have CORS problem.</p>
  
  <pre><code>// node js endpoint
  ApienpointUrl = 'http://localhost:4200/stdApi/student';
  
  // getting data from endpoint
  getStudentfromMock() {
  return this.http.get(this.ApienpointUrl).pipe(
    map((res: any) =&gt; res),
    catchError(this.handleError)
  );
  }
  </code></pre>
  
  <p>Here the Proxy configuration inside angular project proxy.conf.json</p>
  
  <pre><code>{
    "/stdApi/*": {
      "target": "http://localhost:3000",
      "secure": false,
      "logLevel": "debug",
      "changeOrigin": true
    }
  }
  </code></pre>
  
  <p>i am getting error like this:-</p>
  
  <pre><code>"XmlHttpRequet cannot load http://localhost:4200/stdApi/student No Access-Control-Allow-Origin. header is present on the request resources origin 'http://localhost:3000' therefor not allowed access".
  </code></pre>