refactor(WebUI): configure HtpClient

This commit is contained in:
2026-06-15 11:33:03 +02:00
parent cfa6dbd2de
commit 3a2fa77862

View File

@@ -11,6 +11,13 @@ builder.Services.AddRazorComponents()
.AddInteractiveServerComponents()
.AddInteractiveWebAssemblyComponents();
// HttpClient for server-side components (e.g., MainLayout with FontLoader)
builder.Services.AddScoped<HttpClient>(sp => {
var httpClientFactory = sp.GetRequiredService<IHttpClientFactory>();
return httpClientFactory.CreateClient();
});
builder.Services.AddHttpClient();
// YARP Reverse Proxy
builder.Services.AddReverseProxy()
.LoadFromConfig(builder.Configuration.GetSection("ReverseProxy"));