Is there any way to use Ocelot with multiple Configuration files and environments like ocelot.service1.Development.json
?
Unfortunately the documentation seems to be outdated and also it doesn't handle my specific request. I saw that it is able to have multiple files that will be merged Documentation:
ocelot.service1.json
ocelot.service2.json
//Program.cs
return WebHost.CreateDefaultBuilder(args)
.ConfigureAppConfiguration((host, config) => {
config
.AddOcelot(host.HostingEnvironment)
.AddEnvironmentVariables();
})
.UseStartup<Startup>();
}
It works but doesn't meet my requirements.
The documentation also describes following setup Documentation:
ocelot.Development.json
ocelot.Staging.json
//Program.cs
return WebHost.CreateDefaultBuilder(args)
.ConfigureAppConfiguration((host, config) => {
config
.AddJsonFile("ocelot.{host.HostingEnvironment.EnvironmentName}.json", true, true)
.AddEnvironmentVariables();
})
.UseStartup<Startup>();
}
But this solution also doesn't meet my requirements.
Is there any way how I can combine both ways?