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

39 lines
984 B
C#
Raw 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
builder.Services.AddSharedServices("http://localhost:7142");
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();