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.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

Program.cs 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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.AddHttpClient("HttpClient", c =>
  18. {
  19. c.BaseAddress = new Uri(SpotifyService.GLOBALS.SPOTIFYURL);
  20. c.DefaultRequestHeaders.Add("Accept", SpotifyService.GLOBALS.MEDIATYPE);
  21. });
  22. builder.Services.AddControllersWithViews();
  23. builder.Services.AddRazorPages();
  24. builder.Services.AddEndpointsApiExplorer();
  25. builder.Services.AddSwaggerGen();
  26. builder.Services.AddGrpc();
  27. builder.Services.AddCodeFirstGrpc();
  28. builder.Services.AddCodeFirstGrpcReflection();
  29. var app = builder.Build();
  30. app.UseSwagger();
  31. app.UseSwaggerUI();
  32. // Configure the HTTP request pipeline.
  33. if (app.Environment.IsDevelopment())
  34. {
  35. app.UseWebAssemblyDebugging();
  36. }
  37. else
  38. {
  39. app.UseExceptionHandler("/Error");
  40. // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
  41. app.UseHsts();
  42. }
  43. app.UseHttpsRedirection();
  44. app.UseBlazorFrameworkFiles();
  45. app.UseStaticFiles();
  46. app.UseRouting();
  47. app.UseGrpcWeb();
  48. app.MapRazorPages();
  49. app.MapControllers();
  50. //app.MapGrpcService<WeatherService>();
  51. //app.MapGrpcService<SearchService>().EnableGrpcWeb();
  52. app.MapCodeFirstGrpcReflectionService();
  53. app.MapFallbackToFile("index.html");
  54. app.Run();