using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Routing;
using ZB.MOM.WW.ScadaBridge.CentralUI.Audit;
using ZB.MOM.WW.ScadaBridge.CentralUI.Auth;
using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Layout;
using ZB.MOM.WW.ScadaBridge.CentralUI.ScriptAnalysis;
namespace ZB.MOM.WW.ScadaBridge.CentralUI;
public static class EndpointExtensions
{
///
/// Maps the Central UI endpoints. The caller must provide the root App component type
/// from the Host assembly so that blazor.web.js is served correctly.
///
/// The root Blazor App component type, supplied by the Host assembly.
/// The endpoint route builder to register routes on.
/// The same instance, for call chaining.
public static IEndpointRouteBuilder MapCentralUI(this IEndpointRouteBuilder endpoints)
where TApp : Microsoft.AspNetCore.Components.IComponent
{
endpoints.MapAuthEndpoints();
endpoints.MapScriptAnalysisEndpoints();
endpoints.MapAuditExportEndpoints();
endpoints.MapRazorComponents()
.AddInteractiveServerRenderMode()
.AddAdditionalAssemblies(typeof(MainLayout).Assembly);
return endpoints;
}
}