This is the open api and I am trying to fetch data using the URL. But I am getting this error. I can't set the backend to allow localhost. What is my option to make it work ?
Error
has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
what I have tried
let header = new HttpHeaders();
header.set("Access-Control-Allow-Origin", "*");
const URL =
"url here ";
return this.http.get(URL, { headers: header })
.pipe(map(res => res));