Spaces:
Sleeping
Sleeping
Download BlazorWebAssembly/Program.cs from Yuruyuruu/LibraryManagement: direct link, hf CLI and curl.
- Browser
- Download file 1.27 kB
-
https://huggingface.co/spaces/Yuruyuruu/LibraryManagement/resolve/d8a7fc4e47a745fba67b3d0672bbcba735d142c2/BlazorWebAssembly/Program.cs
- Command line
-
hf download hf://spaces/Yuruyuruu/LibraryManagement@d8a7fc4e47a745fba67b3d0672bbcba735d142c2/BlazorWebAssembly/Program.cs
-
curl -L -o Program.cs https://huggingface.co/spaces/Yuruyuruu/LibraryManagement/resolve/d8a7fc4e47a745fba67b3d0672bbcba735d142c2/BlazorWebAssembly/Program.cs
1.27 kB
| using BlazorWebAssembly; | |
| using BlazorWebAssembly.Providers; | |
| using BlazorWebAssembly.Services; | |
| using Blazored.LocalStorage; | |
| using Microsoft.AspNetCore.Components.Authorization; | |
| using Microsoft.AspNetCore.Components.Web; | |
| using Microsoft.AspNetCore.Components.WebAssembly.Hosting; | |
| var builder = WebAssemblyHostBuilder.CreateDefault(args); | |
| builder.RootComponents.Add<App>("#app"); | |
| builder.RootComponents.Add<HeadOutlet>("head::after"); | |
| // Add HttpClient with Backend address | |
| builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("https://localhost:7028/") }); | |
| // Add Blazored LocalStorage | |
| builder.Services.AddBlazoredLocalStorage(); | |
| // Add Authorization Core | |
| builder.Services.AddAuthorizationCore(); | |
| // Register Custom AuthStateProvider | |
| builder.Services.AddScoped<JwtAuthenticationStateProvider>(); | |
| builder.Services.AddScoped<AuthenticationStateProvider>(sp => sp.GetRequiredService<JwtAuthenticationStateProvider>()); | |
| // Register AuthService | |
| builder.Services.AddScoped<AuthService>(); | |
| // Register ThemeService | |
| builder.Services.AddScoped<ThemeService>(); | |
| // Register LibraryApiClient | |
| builder.Services.AddScoped<LibraryApiClient>(); | |
| // Register WishlistService | |
| builder.Services.AddScoped<WishlistService>(); | |
| await builder.Build().RunAsync(); | |