So I'm not quite sure what I'm doing wrong, but I'm bumping into a cross-origin request blocked issue when trying to make an API call to chasing-coins. Two reasons shown:
- CORS header 'Access-Control-Allow-Origin' missing
- CORS request did not succeed
This is my code
fetch('https://chasing-coins.com/api/v1/coins', {
method: 'GET',
headers: { 'Access-Control-Allow-Origin': '*' }
})
.then(response => console.log(response))
What am I doing wrong?
Edit: Not sure if this makes a difference but I'm using localhost and tested both firefox and chrome, both don't work