2025-11-18 20:38:35 +01:00
|
|
|
using DiunaBI.UI.Shared;
|
|
|
|
|
using DiunaBI.UI.Shared.Extensions;
|
|
|
|
|
using DiunaBI.UI.Shared.Services;
|
|
|
|
|
using DiunaBI.UI.Web.Components;
|
|
|
|
|
using MudBlazor.Services;
|
|
|
|
|
|
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
|
|
|
|
|
|
builder.Services.AddRazorComponents()
|
|
|
|
|
.AddInteractiveServerComponents();
|
|
|
|
|
builder.Services.AddMudServices();
|
|
|
|
|
|
2025-11-19 16:57:42 +01:00
|
|
|
var apiBaseUrl = builder.Configuration["ApiSettings:BaseUrl"]
|
2025-11-18 20:38:35 +01:00
|
|
|
?? throw new InvalidOperationException("ApiSettings:BaseUrl is not configured");
|
|
|
|
|
builder.Services.AddSharedServices(apiBaseUrl);
|
|
|
|
|
|
|
|
|
|
var app = builder.Build();
|
|
|
|
|
|
|
|
|
|
if (!app.Environment.IsDevelopment())
|
|
|
|
|
{
|
|
|
|
|
app.UseExceptionHandler("/Error", createScopeForErrors: true);
|
|
|
|
|
app.UseHsts();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
app.UseHttpsRedirection();
|
|
|
|
|
app.UseAntiforgery();
|
|
|
|
|
|
2025-11-19 13:11:07 +01:00
|
|
|
app.MapStaticAssets();
|
|
|
|
|
|
2025-11-18 20:38:35 +01:00
|
|
|
app.MapGet("/health", () => Results.Ok(new { status = "OK", timestamp = DateTime.UtcNow }));
|
|
|
|
|
|
|
|
|
|
app.MapRazorComponents<App>()
|
|
|
|
|
.AddInteractiveServerRenderMode()
|
|
|
|
|
.AddAdditionalAssemblies(typeof(MainLayout).Assembly);
|
|
|
|
|
|
2025-11-06 10:20:00 +01:00
|
|
|
app.Run();
|