diff --git a/EnvelopeGenerator.Web/Program.cs b/EnvelopeGenerator.Web/Program.cs index c0f11f73..5023d931 100644 --- a/EnvelopeGenerator.Web/Program.cs +++ b/EnvelopeGenerator.Web/Program.cs @@ -34,6 +34,12 @@ try var config = builder.Configuration; + Directory + .GetFiles(builder.Environment.ContentRootPath, "appsettings.*.json", SearchOption.TopDirectoryOnly) + .Where(file => Path.GetFileName(file) != $"appsettings.Development.json") + .ToList() + .ForEach(file => config.AddJsonFile(file, true, true)); + var allowedOrigins = config.GetSection("AllowedOrigins").Get() ?? throw new InvalidOperationException("AllowedOrigins section is missing in the configuration.");