No 'Access-Control-Allow-Origin' header is present on the requested resource—when trying to get data from a REST API (cors)

const proxyurl = "https://cors-anywhere.herokuapp.com/";
const url = "https://maps.googleapis.com/maps/api/distancematrix/json?
units=imperial&origins=" + this.lat + "," + this.lng +
"&destinations=" + ulat + "," + ulang +
"&key=AIzaSyC0EvE5yeQM9DTxda79iEn_nd33kh6Y6Hg";
// site that doesn’t send Access-Control-*
let gapi=proxyurl + url;

Comments

Popular posts from this blog

how to split array as per fixed length, and ionic two dates differences in min,seconds,hours

How to Add Firebase Analytics to Your NativeScript Mobile App