- 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.UseAuthentication();
- 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
() - .Build();
how to store ocelot configuration in consul
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
Replies
Know the answer? Post it — somebody with the same question will find it here.