In Angular 5, what do I need to consider regarding CORS, when accessing a remote resource via http.get()
?
EXAMPLE:
let url = `http://www.google.com`;
this.http.get(url).subscribe(res => {
console.log(res.text());
// parse html
});
RESULT:
Failed to load https://www.google.com/:
No 'Access-Control-Allow-Origin' header is present on the requested resource.
Origin 'null' is therefore not allowed access.
core.js:1350 ERROR
Using the Angular and Firebase ecosystem, is there a recommended way to address this issue? Could I e.g. use a Cloud-function to access the remote url via Node.js? How do developers typically address this?