Closed dpalencia closed 3 years ago
I went ahead and deployed a Node.js server on a Heroku container that adds the necessary Access-Control-Allow-Origin header to API requests. This is the URL:
https://flygame-igdb-proxy.herokuapp.com/
Now all we need to do to make API requests is put the Heroku address before the IGDB endpoint. For example,
https://flygame-igdb-proxy.herokuapp.com/https://api.igdb.com/v4/games
We still make requests to the same authentication URL to get an access token (https://id.twitch.tv/oauth2/token) which we can pass to the proxied requests in the same way as per their documentation.
Get images as well from the API request.
Added field "cover.url" to API request to get images. See pull request #8
Screenshot from discord for cover image url sizes
We ran into a CORS issue when trying to query the IGDB API from the React app.
Upon investigation, it looks like we need to set up a proxy URL to make requests to. Details here: https://api-docs.igdb.com/#proxy