© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
3 replies
M B V R K

Ocelot json Help needed

Hi guys,
I'm working on a project using
Microservices architecture
Microservices architecture
, as you know with Microservices mostly we need an
Api Gateway
Api Gateway
,
I use
Ocelot
Ocelot
for that purpose.
I have the following
ocelot.json
ocelot.json
:
{
    "Routes": [
        {
            "DownstreamPathTemplate" : "/api/Categories",
            "DownstreamHostAndPorts":[
                {
                    "Host": "localhost",
                    "Port": 5196,
                    "Scheme": "http"
                }
            ],
            "UpstreamPathTemplate": "/ExpenseService/api/Categories"
        }
    ]
}
{
    "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
Ocelot
has a feature to tell it to automatically re-route
/ExpenseService/api/Categories/{verb}
/ExpenseService/api/Categories/{verb}
to
/api/Categories/{verb}
/api/Categories/{verb}
.

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

Please is there any feature or a way to achieve that ??
Massive thanks in advance <3
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ Help needed converting anon object to JSON
C#CC# / help
3y ago
❔ Ocelot with Swagger
C#CC# / help
3y ago
❔ help needed
C#CC# / help
3y ago
Portfolio Help Needed
C#CC# / help
2y ago