The following code throws this error:
var config = {
method: 'get',
url: `https://euw1.api.riotgames.com/lol/summoner/v4/summoners/by-name/${encodeURI(name)}?api_key=${this.apiKey}`,
headers: {}
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
The request in itself works but I dont know to fix this problem.
Stack from origin 'http://localhost:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.