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;
|
2025-06-19 21:50:35 +02:00
|
|
|
|
|
|
|
|
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>();
|
2025-07-19 22:50:38 +02:00
|
|
|
builder.Services.AddScoped<AuthService>();
|
|
|
|
|
|
2025-07-17 19:17:27 +02:00
|
|
|
|
2025-06-19 21:50:35 +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 }));
|
|
|
|
|
|
2025-06-19 21:50:35 +02:00
|
|
|
app.MapRazorComponents<App>()
|
2025-06-23 15:07:13 +02:00
|
|
|
.AddInteractiveServerRenderMode()
|
|
|
|
|
.AddAdditionalAssemblies(typeof(MainLayout).Assembly);
|
2025-06-19 21:50:35 +02:00
|
|
|
|
|
|
|
|
app.Run();
|