PIbd-22_Chernyshev_Shabunov.../ComputerShopGuarantorApp/Program.cs

31 lines
701 B
C#
Raw Normal View History

2024-05-28 13:22:24 +04:00
using ComputerShopGuarantorApp;
var Builder = WebApplication.CreateBuilder(args);
2024-05-02 00:13:15 +04:00
// Add services to the container.
2024-05-28 13:22:24 +04:00
Builder.Services.AddControllersWithViews();
2024-05-02 00:13:15 +04:00
2024-05-28 13:22:24 +04:00
var App = Builder.Build();
ApiUser.Connect(Builder.Configuration);
2024-05-02 00:13:15 +04:00
// Configure the HTTP request pipeline.
2024-05-28 13:22:24 +04:00
if (!App.Environment.IsDevelopment())
2024-05-02 00:13:15 +04:00
{
2024-05-28 13:22:24 +04:00
App.UseExceptionHandler("/Home/Error");
2024-05-02 00:13:15 +04:00
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
2024-05-28 13:22:24 +04:00
App.UseHsts();
2024-05-02 00:13:15 +04:00
}
2024-05-28 13:22:24 +04:00
App.UseHttpsRedirection();
App.UseStaticFiles();
2024-05-02 00:13:15 +04:00
2024-05-28 13:22:24 +04:00
App.UseRouting();
2024-05-02 00:13:15 +04:00
2024-05-28 13:22:24 +04:00
App.UseAuthorization();
2024-05-02 00:13:15 +04:00
2024-05-28 13:22:24 +04:00
App.MapControllerRoute(
2024-05-02 00:13:15 +04:00
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
2024-05-28 13:22:24 +04:00
App.Run();