add some debug info
All checks were successful
Build Docker Images / test (push) Successful in 1m14s
Build Docker Images / build-and-push (push) Successful in 1m37s

This commit is contained in:
2025-11-19 17:30:36 +01:00
parent c0a1945465
commit 66a9b975a5
3 changed files with 44 additions and 5 deletions

View File

@@ -1,5 +1,6 @@
using Microsoft.Extensions.DependencyInjection;
using DiunaBI.UI.Shared.Services;
using DiunaBI.UI.Shared.Handlers;
namespace DiunaBI.UI.Shared.Extensions;
@@ -7,10 +8,23 @@ public static class ServiceCollectionExtensions
{
public static IServiceCollection AddSharedServices(this IServiceCollection services, string apiBaseUrl)
{
// HttpClient for API calls
// HttpClient for API calls with logging
// Ensure BaseAddress ends with / for proper relative URL resolution
var baseUri = apiBaseUrl.EndsWith('/') ? apiBaseUrl : apiBaseUrl + "/";
services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(baseUri) });
services.AddTransient<HttpLoggingHandler>();
services.AddHttpClient<AuthService>(client =>
{
client.BaseAddress = new Uri(baseUri);
})
.AddHttpMessageHandler<HttpLoggingHandler>();
services.AddHttpClient<LayerService>(client =>
{
client.BaseAddress = new Uri(baseUri);
})
.AddHttpMessageHandler<HttpLoggingHandler>();
// Services
services.AddScoped<AuthService>();