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 Add Firebase Analytics to Your NativeScript Mobile App

sidemenu refresh through events

push multiple data in array(select and disselect items in array)