using Microsoft.Extensions.Configuration;

namespace Insight.Agent.Extensions
{
    public static class ConfigurationExtensions
    {
        public static IConfigurationBuilder Defaults(this IConfigurationBuilder configuration)
        {
            configuration.Sources.Clear();
            configuration.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);
            return configuration.AddJsonFile($"appsettings.{Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT")}.json", optional: true, reloadOnChange: true);
        }
    }
}