Program.cs 643 B

123456789101112131415161718192021222324252627
  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.UseStaticFiles();
  14. app.UseRouting();
  15. app.UseAuthorization();
  16. app.MapControllerRoute(
  17. name: "default",
  18. pattern: "{controller=Home}/{action=Index}/{id?}");
  19. app.Run();