How add condition routing using Ocelot?

967 views Asked by At

I have a Web API which has two endpoints:

  1. /tenant1/xxx
  2. /tenant2/xxx

The Web API serves multiple tenants and it is hosted as a single instance. Now I have to public this Web API to the outside for using, from the third party, they don't need to know which tenant they should call, instead, they call /api/dosomething (another web API), and inside that API, I will look at the parameter and decide which tenant I should reroute. I use Ocelot as API Gateway but searching on the document I can not find the condition routing. Can anyone help me with this?

1

There are 1 answers

0
Steve Lam On BEST ANSWER

Ocelot supports DelegatingHandler which play as middleware for out-going request