Program.cs 630 B

12345678910111213141516171819202122232425262728
  1. var builder = WebApplication.CreateBuilder(args);
  2. builder.Services.AddServerSideBlazor();
  3. // Add services to the container.
  4. builder.Services.AddRazorPages();
  5. var app = builder.Build();
  6. app.UseStaticFiles();
  7. // Configure the HTTP request pipeline.
  8. if (!app.Environment.IsDevelopment())
  9. {
  10. app.UseExceptionHandler("/Error");
  11. // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
  12. app.UseHsts();
  13. }
  14. app.UseHttpsRedirection();
  15. app.UseStaticFiles();
  16. app.UseRouting();
  17. app.UseAuthorization();
  18. app.MapRazorPages();
  19. app.MapBlazorHub();
  20. app.Run();