I am trying to use the cryptocompare api to get a list of coindata with axios but I can't figure out how to get around this issue I believe it's a CORS issue, but I am not sure.
The full error is as follows: Failed to load https://www.cryptocompare.com/api/data/coinlist/: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. The response had HTTP status code 524.
I am using axios with the following code:
addCoinData(coinData) {
axios.get('https://www.cryptocompare.com/api/data/coinlist/')
.then(res => {
const crypto = res.data;
this.setState({crypto: crypto});
})
.catch(function (error) {
console.log(error);
});
console.log(this.state.crypto);
};