BenFradet / RiotSharp

C# wrapper for the Riot Games API
http://benfradet.github.io/RiotSharp/
MIT License
300 stars 145 forks source link

Usage In Blazor WASM #682

Open thompcd opened 3 years ago

thompcd commented 3 years ago

Hi! I tried to create a proof of concept using the api within the standard Microsoft Blazor PWA template and receive a CORS exception when trying to fetch from my index component.

Are there any examples of using this within a Blazor web assembly app? It looks like there are workarounds using proxies, would like to know if this has been done already.

Thanks!

JanOuborny commented 3 years ago

It's certainly only possible using a proxy server, because otherwise you would expose your api key to your users. You could use NGINX to attach the authentication header with your api key to the proxied request. Should be very simple to set up.