drvicx / jdm-timesheet-cloud

Timesheet 2.0 Spring Cloud project with microservices
0 stars 0 forks source link

Fix Angular REST-Client CORS Error #11

Closed drvicx closed 3 years ago

drvicx commented 3 years ago

Fix Angular REST-Client CORS Error raised when accessing to REST-API User and Timedata endoints; Error log on Client side (Google Chrome console):

Access to XMLHttpRequest at 'http://localhost:9002/api/service-user/users/getsingle/1' 
   from origin 'http://localhost:4200'
      has been blocked by CORS policy:
        No 'Access-Control-Allow-Origin' header is present on the requested resource.
GET http://localhost:9002/api/service-user/users/getsingle/1 net::ERR_FAILED
ERROR HttpErrorResponse {headers: HttpHeaders, status: 0, statusText: "Unknown Error",
   url: "//localhost:9002/api/service-user/users/getsingle/1", ok: false, …}