-
Hello Folks, I've multiple Services [for example KM and NLP] What I want to achieve is the following: If I get any requests like:
another example I can get is something like that
How can I do something like that? So I need to redirect the URL as is and have to take into consideration the HTTP action method [GET, PUT, etc..] Is that possible? I tried something like that, but doesn't work as expected. "UpstreamPathTemplate": "/api/v1/KM/{everything}",
"DownstreamPathTemplate": "/api/v1/KM/{everything}",
"DownstreamScheme": "https",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 3000
} |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 8 replies
-
@ks1990cn Please help! @AShaker01 I see a sense only if the hosts are different. |
Beta Was this translation helpful? Give feedback.
-
@AShaker01 Hi, You need your route like this in Ocelot.json Here is doc https://ocelot.readthedocs.io/en/latest/features/routing.html Make sure you are not conflicting with paths. More help - https://www.youtube.com/watch?v=hlUGZ6Hmv6s What do you exactly mean when you say
|
Beta Was this translation helpful? Give feedback.
-
Using everything in the route working as expected. so i ended up by defining two routes that's way in the first glance i thought that everything doesn't work :) thanks for everyone's support and jokes 😁 |
Beta Was this translation helpful? Give feedback.
Using everything in the route working as expected.
the issue was that I've a route like/api/products
and this should be mapping to products controller get method.
but when I've defined the upstream route likes /api/products/everything.
all the routes worked except that route /api/products
so i ended up by defining two routes
one specific for the api/products
and one generic for all other routes api/products/{everything}
that's way in the first glance i thought that everything doesn't work :)
thanks for everyone's support and jokes 😁