When running the following fetch request in my React project:
const options = { method: "GET", headers: { accept: "application/json", "Access-Control-Allow-Origin": "*" } };
response = await fetch(
`https://api.b365api.com/v1/bet365/upcoming?league_id=${league}&sport_id=${sport.id}&token=TOKEN`,
options
).catch((err) => console.error(err));
The request returns with the error Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://api.b365api.com/v1/bet365/upcoming?league_id=131095496&sport_id=1&token=TOKEN. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.
I've searched through A LOT of different pages and haven't found an answer I can use other than using a proxy of some sort like https://cors-anywhere.herokuapp.com/ which has a limit and just doesn't work in production.