SUBD_PIbd-23_ZakharovRA/CarShowroom/CarShowroomManagerApp/Program.cs

39 lines
1.0 KiB
C#
Raw Normal View History

2024-05-13 12:37:11 +04:00
using CarShowroomDataModels.Models;
2024-05-12 14:05:30 +04:00
namespace CarShowroomManagerApp
{
public class Program
{
public static void Main(string[] args)
{
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllersWithViews();
2024-05-13 12:37:11 +04:00
var app = builder.Build();
2024-05-12 14:05:30 +04:00
2024-05-13 12:37:11 +04:00
ApiClient.Connect(builder.Configuration);
2024-05-12 14:05:30 +04:00
2024-05-13 12:37:11 +04:00
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
2024-05-12 14:05:30 +04:00
{
app.UseExceptionHandler("/Home/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();
app.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
app.Run();
}
}
}