diff --git a/src/WebUI/CleanMicroserviceSystem.Aphrodite.Infrastructure/DependencyInjection.cs b/src/WebUI/CleanMicroserviceSystem.Aphrodite.Infrastructure/DependencyInjection.cs index 02663b8a..1aabcfe4 100644 --- a/src/WebUI/CleanMicroserviceSystem.Aphrodite.Infrastructure/DependencyInjection.cs +++ b/src/WebUI/CleanMicroserviceSystem.Aphrodite.Infrastructure/DependencyInjection.cs @@ -16,9 +16,6 @@ namespace CleanMicroserviceSystem.Aphrodite.Infrastructure; public static class DependencyInjection { - private const string NuGetServerConfigurationKey = "NuGetServerConfiguration"; - private const string GatewayAPIConfigurationKey = "GatewayAPIConfiguration"; - public static IServiceCollection ConfigureServices(this WebAssemblyHostBuilder builder) { var config = builder.Configuration; @@ -51,7 +48,8 @@ public static IServiceCollection ConfigureServices(this WebAssemblyHostBuilder b ApiContract.AphroditeHttpClientName, client => client.BaseAddress = new Uri(builder.HostEnvironment.BaseAddress)); _ = services - .Configure(options => config.GetRequiredSection(GatewayAPIConfigurationKey).Bind(options)) + .Configure(options => config.GetRequiredSection(GatewayAPIConfiguration.ConfigurationKey).Bind(options)) + .Configure(options => config.GetRequiredSection(AppearanceConfiguration.ConfigurationKey).Bind(options)) .AddThemisClients(options => { options.GatewayClientName = ApiContract.GatewayHttpClientName; @@ -59,12 +57,12 @@ public static IServiceCollection ConfigureServices(this WebAssemblyHostBuilder b .AddAstraClients(options => { options.GatewayClientName = ApiContract.GatewayHttpClientName; - options.ApiKey = config.GetRequiredSection(NuGetServerConfigurationKey)!.Get()!.ApiKey; + options.ApiKey = config.GetRequiredSection(NuGetServerConfiguration.ConfigurationKey)!.Get()!.ApiKey; }) .AddTransient() .AddHttpClient( ApiContract.GatewayHttpClientName, - client => client.BaseAddress = new Uri(config.GetRequiredSection(GatewayAPIConfigurationKey).Get()!.GatewayBaseAddress)) + client => client.BaseAddress = new Uri(config.GetRequiredSection(GatewayAPIConfiguration.ConfigurationKey).Get()!.GatewayBaseAddress)) .AddHttpMessageHandler(); return services; }