using BimAI.UI.Shared; using BimAI.UI.Shared.Extensions; using BimAI.UI.Shared.Interfaces; using BimAI.UI.Shared.Services; using BimAI.UI.Web.Components; using MudBlazor.Services; var builder = WebApplication.CreateBuilder(args); builder.Services.AddRazorComponents() .AddInteractiveServerComponents(); builder.Services.AddMudServices(); var apiBaseUrl = builder.Configuration["ApiSettings:BaseUrl"] ?? throw new InvalidOperationException("ApiSettings:BaseUrl is not configured"); builder.Services.AddSharedServices(apiBaseUrl); builder.Services.AddSingleton(); builder.Services.AddScoped(); var app = builder.Build(); if (!app.Environment.IsDevelopment()) { app.UseExceptionHandler("/Error", createScopeForErrors: true); app.UseHsts(); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseAntiforgery(); app.MapGet("/health", () => Results.Ok(new { status = "OK", timestamp = DateTime.UtcNow })); app.MapRazorComponents() .AddInteractiveServerRenderMode() .AddAdditionalAssemblies(typeof(MainLayout).Assembly); app.Run();