TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
陈哲 陈哲
NA
2
1.2k
how to store ocelot configuration in consul
Jun 20 2018 10:04 PM
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.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<Startup>()
.Build();
Reply
Answers (
0
)
Pop out a new page inside an update if statement
Error uploading image (in bytes) to a HTTP File server