Is there any way to enforce requests to a project controller with Ocelet (my GatewayApi project) for example create the check url to register in the Consul.
URL to check the integrity of my GatewayAPI in the .NET core.
When I make any request for a controller in my GatewayApi project, I always get an error with the message "Could not find the downstream route to the path"
@lucianoscastro 网关的健康检查,可以在预留中间件里添加健康检查地址,不过一般这个地址都是给nginx使用的
var conf = new OcelotPipelineConfiguration() { PreErrorResponderMiddleware = async (ctx, next) => { if (ctx.HttpContext.Request.Path.Equals(new PathString("/"))) { await ctx.HttpContext.Response.WriteAsync("ok"); } else { await next.Invoke(); } } }; app.UseOcelot(conf).Wait();
@lucianoscastro "Could not find the downstream route to the path" means that Ocelot cannot find your anything in json configuration for your requested route.
Can you share your configuration json?
Ocelot doesn't do health checks at the moment. I would suggest using Consul if you want that functionality.
I think the idea behind this is to add a healthcheck endpoint to the ocelot gateway itself, so that you can check that it's up and running.
Most helpful comment
@lucianoscastro 网关的健康检查,可以在预留中间件里添加健康检查地址,不过一般这个地址都是给nginx使用的