Program.cs (703B)
1 var builder = WebApplication.CreateBuilder(args); 2 3 // Add services to the container. 4 5 builder.Services.AddControllersWithViews(); 6 builder.Services.AddRazorPages(); 7 8 var app = builder.Build(); 9 10 // Configure the HTTP request pipeline. 11 if (app.Environment.IsDevelopment()) 12 { 13 app.UseWebAssemblyDebugging(); 14 } 15 else 16 { 17 app.UseExceptionHandler("/Error"); 18 // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 19 app.UseHsts(); 20 } 21 22 app.UseHttpsRedirection(); 23 24 app.UseBlazorFrameworkFiles(); 25 app.UseStaticFiles(); 26 27 app.UseRouting(); 28 29 30 app.MapRazorPages(); 31 app.MapControllers(); 32 app.MapFallbackToFile("index.html"); 33 34 app.Run();