WIP: frontend refactor

This commit is contained in:
Michał Zieliński
2025-11-06 10:20:00 +01:00
parent 5bee3912f1
commit 7f04cab0d9
38 changed files with 1254 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
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();
var apiBaseUrl = builder.Configuration["ApiSettings:BaseUrl"]
?? throw new InvalidOperationException("ApiSettings:BaseUrl is not configured");
builder.Services.AddSharedServices(apiBaseUrl);
builder.Services.AddScoped<AuthService>();
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<App>()
.AddInteractiveServerRenderMode()
.AddAdditionalAssemblies(typeof(MainLayout).Assembly);
app.Run();