Files
FACULTATE-HEALTHCARE_MANAGER/frontend/HealthcareManagerUI/Program.cs
T

39 lines
1.2 KiB
C#

using Blazored.LocalStorage;
using HealthcareManagerUI;
using HealthcareManagerUI.Services.Http;
using HealthcareManagerUI.Services.TokenService;
using AuthenticationService = Microsoft.AspNetCore.Authentication.AuthenticationService;
using IAuthenticationService = Microsoft.AspNetCore.Authentication.IAuthenticationService;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
builder.Services.AddScoped<IRequestHttpService>(provider =>
{
var configuration = provider.GetRequiredService<IConfiguration>();
return new RequestHttpService(configuration);
});
builder.Services.AddScoped<IAuthenticationService, AuthenticationService>();
builder.Services.AddBlazoredLocalStorage();
builder.Services.AddScoped<ITokenService, TokenService>();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error", true);
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseAntiforgery();
app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode();
app.Run();