Hi. I want to store configuration in consul following doc (http://ocelot.readthedocs.io/en/latest/features/configuration.html#store-configuration-in-consul) ; but i can't running successfully
- public void ConfigureServices(IServiceCollection services)
- {
- services.AddMvc();
-
- services.AddOcelot().AddStoreOcelotConfigurationInConsul();
- }
-
- public async void Configure(IApplicationBuilder app, IHostingEnvironment env)
- {
- if (env.IsDevelopment())
- {
- app.UseDeveloperExceptionPage();
- }
-
- await app.UseOcelot();
-
-
-
- app.UseMvc();
- }
-
-
- Program.cs
- public static IWebHost BuildWebHost(string[] args) =>
- WebHost.CreateDefaultBuilder(args)
- .UseContentRoot(Directory.GetCurrentDirectory())
- .ConfigureAppConfiguration((builderContext, config) =>
- {
- config
- .SetBasePath(builderContext.HostingEnvironment.ContentRootPath)
- .AddJsonFile("ocelot.json", optional: false, reloadOnChange: true)
- .AddEnvironmentVariables();
- })
- .UseStartup<Startup>()
- .Build();