achievements-app / psn-api

A JavaScript library that lets you get trophy, user, and game data from the PlayStation Network.
https://psn-api.achievements.app
MIT License
263 stars 31 forks source link

Having problems with Cors using the api in Ionic framework #150

Closed FernandoFiorini closed 11 months ago

FernandoFiorini commented 11 months ago

Access to fetch at 'psnURL' from origin 'http://localhost:8100' 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. Have to install any plugins?

wescopeland commented 11 months ago

Sony themselves are responsible for this CORS policy, which Ionic is going to honor. For calling the endpoints client-side, you'll need to set up a Node.js API which uses psn-api that your Ionic app calls, rather than using psn-api directly within your Ionic app.