using Easy.AuthorityManagement.Clean.Contracts; using Easy.AuthorityManagement.Infrastructure; using Easy.Extensions; namespace Easy.AuthorityManagement; public static class ProgramExtension { public static WebApplication ConfigureServices(this WebApplicationBuilder builder) { builder.Services.AddHttpContextAccessor(); builder.Services.AddGlobalForServer(); builder.Services.AddHttpClient(); builder.Services.AddRazorPages(); builder.Services.AddServerSideBlazor(); builder.Services.AddMasaBlazor(); builder.Services.AddPermissionManagement(); return builder.Build(); } public static WebApplication ConfigurePipeline(this WebApplication app) { app.LocalEnv(); app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseRouting(); app.MapBlazorHub(); app.MapFallbackToPage("/_Host"); return app; } private static void LocalEnv(this WebApplication app) { // Configure the HTTP request pipeline. if (!app.Environment.IsDevelopment()) { app.UseExceptionHandler("/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(); } } }