简体   繁体   中英

CORS header 'Access-Control-Allow-Origin' missing Error

I am currently building a dashboard for chrome. I am trying to display coin prices on the dashboard by getting the information through coin gecko's API. I get this error when I run my code "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://api.coingecko.com/api/v3/coins/dogecoin . (Reason: CORS header 'Access-Control-Allow-Origin' missing).", and get the same error when I try to execute on the coin gecko API V3 site.

This is my code:

fetch("https://api.coingecko.com/api/v3/coins/dogecoin").then(response => response.json()).then(data =>console.log(data)).catch(err => console.log(err))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM