Use the Twitchtv JSON API: Cross-Origin Request Blocked

Hey everyone, I’m trying to complete the project that involves the Twitchtv JSON API but I’m having trouble getting data from Free Code Camp’s Twitch API Pass-through (https://wind-bow.gomix.me/twitch-api). When I attempt to access data from the /streams/:stream route, I get the following error:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://wind-bow.gomix.me/twitch-api/streams/freecodecamp. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).

Has anyone come across this error?

I’m using the fetch API to make the request.

At the end of your API call add “?callback=?”

I get the same error:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://wind-bow.gomix.me/twitch-api/streams/freecodecamp/?callback=?.

I think the easiest way to get around the Cross-Origin issue for this project is to use JSONP, but I’m not sure that it’s supported by fetch().
So I guess one solution is to use jQuery’s ajax(), and another is to keep using fetch(), but also figure out how to work with CORS.

Thanks for your response. I ended up switching to jQuery’s getJSON method.