Blazor & WASM in combination to get statistics from Spotify API for performing the song analysis. With separate microservices for auth, Spotify, user data tracking, and application, connected through gRPC with Polly.
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324
  1. using Grpc.Net.Client;
  2. using Grpc.Net.Client.Web;
  3. using Microsoft.AspNetCore.Components;
  4. using Microsoft.AspNetCore.Components.Web;
  5. using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
  6. using NemAnBlazor;
  7. using SpotifyService.Protos;
  8. var builder = WebAssemblyHostBuilder.CreateDefault(args);
  9. builder.RootComponents.Add<App>("#app");
  10. builder.RootComponents.Add<HeadOutlet>("head::after");
  11. builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
  12. builder.Services.AddSingleton(services =>
  13. {
  14. var httpClient = new HttpClient(new GrpcWebHandler(GrpcWebMode.GrpcWeb, new HttpClientHandler()));
  15. var baseUri = services.GetRequiredService<NavigationManager>().BaseUri;
  16. var channel = GrpcChannel.ForAddress(baseUri, new GrpcChannelOptions { HttpClient = httpClient });
  17. return new Search.SearchClient(channel);
  18. });
  19. await builder.Build().RunAsync();