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文字以内のものにしてください。

Program.cs 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using Microsoft.AspNetCore.Server.Kestrel.Core;
  2. using ProtoBuf.Grpc.Server;
  3. using SpotifyService.Services;
  4. var builder = WebApplication.CreateBuilder(args);
  5. #if DEBUG
  6. /*
  7. builder.WebHost.ConfigureKestrel(options =>
  8. {
  9. options.ListenLocalhost(5050, o => o.Protocols =
  10. HttpProtocols.Http2);
  11. options.ListenLocalhost(5051, o => o.Protocols =
  12. HttpProtocols.Http1AndHttp2);
  13. });
  14. */
  15. #endif
  16. // Add services to the container.
  17. builder.Services.AddControllersWithViews();
  18. builder.Services.AddRazorPages();
  19. builder.Services.AddEndpointsApiExplorer();
  20. builder.Services.AddSwaggerGen();
  21. builder.Services.AddGrpc();
  22. builder.Services.AddCodeFirstGrpc();
  23. builder.Services.AddCodeFirstGrpcReflection();
  24. var app = builder.Build();
  25. app.UseSwagger();
  26. app.UseSwaggerUI();
  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<SearchService>().EnableGrpcWeb();
  47. app.MapCodeFirstGrpcReflectionService();
  48. app.MapFallbackToFile("index.html");
  49. app.Run();