C#C
C#2y ago
M B V R K

Ocelot json Help needed

Hi guys,
I'm working on a project using Microservices architecture, as you know with Microservices mostly we need an Api Gateway,
I use Ocelot for that purpose.
I have the following ocelot.json:
{
    "Routes": [
        {
            "DownstreamPathTemplate" : "/api/Categories",
            "DownstreamHostAndPorts":[
                {
                    "Host": "localhost",
                    "Port": 5196,
                    "Scheme": "http"
                }
            ],
            "UpstreamPathTemplate": "/ExpenseService/api/Categories"
        }
    ]
}

The issue:

The issue is the categories controller will contains many actions, so I think that maybe the Ocelot has a feature to tell it to automatically re-route /ExpenseService/api/Categories/{verb} to /api/Categories/{verb}.

I have tried /ExpenseService/api/Categories/{everything} to /api/Categories/{everything}, but not working.

Please is there any feature or a way to achieve that ??
Massive thanks in advance <3
Was this page helpful?