I am running two applications on my local desktop.
One is built in java which serves as the API, the other one is built in Angular which is the front-end application.
I am trying to access the backend data from Angular and I am running into an error :
Access to XMLHttpRequest at 'http://localhost:8080' from origin 'http://localhost:4200' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
public getMethod(): Observable<Availability[]> {
return this.http
.get(API_URL)
.map(response => {
})
.catch(this.handleError);
}
I am doing something like this in Angular to grab the data, and the error keeps coming up.
My question is, is this an angular error, or a Backend error(Java)?