Files
BimAI/BimAI.UI.Web/Program.cs

40 lines
1.1 KiB
C#
Raw Permalink Normal View History

2025-10-11 11:33:46 +02:00
using BimAI.UI.Shared;
using BimAI.UI.Shared.Extensions;
using BimAI.UI.Shared.Interfaces;
using BimAI.UI.Shared.Services;
using BimAI.UI.Web.Components;
2025-06-23 15:07:13 +02:00
using MudBlazor.Services;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
2025-06-23 15:07:13 +02:00
builder.Services.AddMudServices();
2025-07-17 14:29:02 +02:00
2025-10-19 12:01:10 +02:00
var apiBaseUrl = builder.Configuration["ApiSettings:BaseUrl"]
?? throw new InvalidOperationException("ApiSettings:BaseUrl is not configured");
builder.Services.AddSharedServices(apiBaseUrl);
2025-07-17 14:29:02 +02:00
2025-07-17 19:17:27 +02:00
builder.Services.AddSingleton<IScannerService, NoOpScannerService>();
builder.Services.AddScoped<AuthService>();
2025-07-17 19:17:27 +02:00
var app = builder.Build();
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error", createScopeForErrors: true);
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseAntiforgery();
2025-10-12 20:17:33 +02:00
app.MapGet("/health", () => Results.Ok(new { status = "OK", timestamp = DateTime.UtcNow }));
app.MapRazorComponents<App>()
2025-06-23 15:07:13 +02:00
.AddInteractiveServerRenderMode()
.AddAdditionalAssemblies(typeof(MainLayout).Assembly);
app.Run();