I'm making this JavaScript project based on Challonge API.
Whenever i attempt to use fetch to either GET or POST any data, I'm being returned the infamous CORS error:
Access to fetch at 'https://api.challonge.com/v1/tournaments.json?api_key=censored' from origin 'http://127.0.0.1:8080' 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.
It works flawlessly whenever i use the "Allow-Control-Allow-Origin * " extension, for obvious reasons, however, i can't demand my clients to download this extension to use my app. I've also tried uploading the project to a webserver, with no success.
I've been scouring the web for solutions, but I'm either too incompetent to see the answer right in front of me, or I haven't looked long enough.
Either way, can any one of you nudge me in the right direction?
Edit: I've tried to change the request mode to no-cors, same-origin and cors, to no avail.
Edit 2: alot of the 'fixes' I've seen for this revolved around changing the server-side .htaccess to allow my domain, but i'm not working for Challonge API, and I refuse to believe that's the only way