Issue #3: add gateway configuration and validation

This commit is contained in:
Joseph Doherty
2026-04-26 16:11:30 -04:00
parent 16c18954b6
commit 91ea71b0b7
26 changed files with 657 additions and 1 deletions
@@ -0,0 +1,19 @@
using Microsoft.Extensions.Options;
namespace MxGateway.Server.Configuration;
public static class GatewayConfigurationServiceCollectionExtensions
{
public static IServiceCollection AddGatewayConfiguration(this IServiceCollection services)
{
services
.AddOptions<GatewayOptions>()
.BindConfiguration(GatewayOptions.SectionName)
.ValidateOnStart();
services.AddSingleton<IValidateOptions<GatewayOptions>, GatewayOptionsValidator>();
services.AddSingleton<IGatewayConfigurationProvider, GatewayConfigurationProvider>();
return services;
}
}