PIbd-22_Fedorenko_Puchkina_.../LawFim/LawFirmGuarantorApp/Program.cs

36 lines
1013 B
C#
Raw Normal View History

2024-05-01 20:47:42 +04:00
using LawFirmContracts.StoragesContracts;
using LawFirmDatabaseImplement.Implements;
using LawFirmGuarantorApp;
var builder = WebApplication.CreateBuilder(args);
2024-05-01 20:47:42 +04:00
builder.Services.AddTransient<IConsultationStorage, ConsultationStorage>();
builder.Services.AddTransient<IHearingStorage, HearingStorage>();
builder.Services.AddTransient<ILawyerStorage, LawyerStorage>();
// Add services to the container.
builder.Services.AddControllersWithViews();
var app = builder.Build();
APIClient.Connect(builder.Configuration);
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
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=EnterGuarantor}/{id?}");
app.Run();