Program.cs 669 B

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