I’m getting this cors policy error when fetching data for the first nft in a users wallet how can I bypass this?
All the users NFT’s show up in the console log and the website it is getting the NFT Json data from is correct when the error comes up just the CORS policy is keeping me from retrieving it.
Access to fetch has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. If an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled.
const userEthNFTs = await Moralis.Web3.getNFTs();
const nftCount = await Moralis.Web3.getNFTsCount();
console.log(userEthNFTs);
var nftboy = userEthNFTs[0];
let url = nftboy.token_uri
fetch(url)
.then(response => response.json())
.then(data => {
document.getElementById("nftboyname").innerHTML = data.name;
document.getElementById("nftboyinfo").innerHTML = data.info;
document.getElementById("nftboyimage").innerHTML = data.image;