refactor(WebUI): configure HtpClient
This commit is contained in:
@@ -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"));
|
||||
|
||||
Reference in New Issue
Block a user