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.
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

Program.cs 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using GrpcShared;
  2. using IdentityProvider.Services;
  3. using Microsoft.AspNetCore.Server.Kestrel.Core;
  4. using ProtoBuf.Grpc.Server;
  5. using Microsoft.Extensions.Options;
  6. var builder = WebApplication.CreateBuilder(args);
  7. #if DEBUG
  8. builder.WebHost.ConfigureKestrel(options =>
  9. {
  10. options.ListenLocalhost(5050, o => o.Protocols =
  11. HttpProtocols.Http2);
  12. options.ListenLocalhost(5051, o => o.Protocols =
  13. HttpProtocols.Http1AndHttp2);
  14. });
  15. #endif
  16. builder.Services.AddOptions();
  17. // Additional configuration is required to successfully run gRPC on macOS.
  18. // For instructions on how to configure Kestrel and gRPC clients on macOS, visit https://go.microsoft.com/fwlink/?linkid=2099682
  19. builder.Services.Configure<AuthParams>(builder.Configuration.GetSection("AuthParams"));
  20. builder.Services.AddControllersWithViews();
  21. builder.Services.AddRazorPages();
  22. builder.Services.AddEndpointsApiExplorer();
  23. builder.Services.AddGrpc();
  24. builder.Services.AddCodeFirstGrpc();
  25. builder.Services.AddCodeFirstGrpcReflection();
  26. var app = builder.Build();
  27. // Configure the HTTP request pipeline.
  28. if (app.Environment.IsDevelopment())
  29. {
  30. app.UseWebAssemblyDebugging();
  31. }
  32. else
  33. {
  34. app.UseExceptionHandler("/Error");
  35. // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
  36. app.UseHsts();
  37. }
  38. app.UseHttpsRedirection();
  39. app.UseBlazorFrameworkFiles();
  40. app.UseStaticFiles();
  41. app.UseRouting();
  42. app.UseGrpcWeb();
  43. app.MapRazorPages();
  44. app.MapControllers();
  45. //app.MapGrpcService<WeatherService>();
  46. app.MapGrpcService<AuthService>().EnableGrpcWeb();
  47. app.MapCodeFirstGrpcReflectionService();
  48. app.MapFallbackToFile("index.html");
  49. app.Run();