mirror of
https://github.com/Sarsoo/Spotify.NET.git
synced 2024-12-25 15:36:26 +00:00
1.3 KiB
1.3 KiB
id | title |
---|---|
example_blazor_wasm | Blazor WASM |
Description
This small cross-platform web app runs on Blazor WebAssembly
, which was released on 19. May 2020. It allows to run C# code in any browser which supports WebAssembly. This allows to create .NET full-stack web projects without writing any JavaScript. Find more about Blazor WebAssembly here
Since this library is compatible with .NET Standard 2.1
, you can use all features of SpotifyAPI.Web
in your blazor wasm app. The example logs the user in via Implicit Grant
and does 2 user-related API requests from the browser. You can observe the requests from your browsers network tools.
Run it
Before running it, make sure you created an app in your spotify dashboard and https://localhost:5001
is a redirect uri of it.
# Assumes linux and current working directory is the cloned repository
cd SpotifyAPI.Web.Examples/Example.BlazorWASM
dotnet restore
echo "{ \"SPOTIFY_CLIENT_ID\": \"YourSpotifyClientId\" }" > wwwroot/appsettings.json
dotnet run
# Visit https://localhost:5001