after refactor cleanup
This commit is contained in:
38
DiunaBI.UI.Web/Program.cs
Normal file
38
DiunaBI.UI.Web/Program.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
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<IGoogleAuthService, WebGoogleAuthService>();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
if (!app.Environment.IsDevelopment())
|
||||
{
|
||||
app.UseExceptionHandler("/Error", createScopeForErrors: true);
|
||||
app.UseHsts();
|
||||
}
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
app.UseAntiforgery();
|
||||
|
||||
app.MapStaticAssets();
|
||||
|
||||
app.MapGet("/health", () => Results.Ok(new { status = "OK", timestamp = DateTime.UtcNow }));
|
||||
|
||||
app.MapRazorComponents<App>()
|
||||
.AddInteractiveServerRenderMode()
|
||||
.AddAdditionalAssemblies(typeof(MainLayout).Assembly);
|
||||
|
||||
app.Run();
|
||||
Reference in New Issue
Block a user