Hi so all day I've been trying to grab data from an external API. Using postman, I'm able to send a get request to it and it's fine; but when I use fetch to call the API in my next.js app, I get a cross origin error. Easy fix, just add the allow headers? But no, it cannot get it to work properly. I installed a CORS chrome extension and the localhost was able to call the request to the external API but that's obviously just a temp fix.
fetch('https://ANYAPI.cloud/api/info')
.then(response => response.json())
.then(data => setInfo(data))
.catch(error => console.error(error));
I've looked up ways to workaround CORS but they either didn't work or were something unrelated. Is there some special configuration that I'm missing?