Ocelot request not going through the desired priority

52 views Asked by At

I have implemented Ocelot API gateway in my project

{
      "DownstreamPathTemplate": "/api/{suffix}",
      "DownstreamScheme": "http",
      "DownstreamHostAndPorts": [
        {
          "Host": "localhost",
          "Port": 5001
        }
      ],
      "UpstreamPathTemplate": "/admin/v1/{suffix}",
      "UpstreamHttpMethod": [ "Get", "Post", "Put", "Delete", "Patch" ],
      "RequestIdKey": "admin",
      "Priority": 2
    },
    {
      "DownstreamPathTemplate": "/api/{version}/{suffix}",
      "DownstreamScheme": "http",
      "DownstreamHostAndPorts": [
        {
          "Host": "localhost",
          "Port": 5001
        }
      ],
      "UpstreamPathTemplate": "/admin/{version}/{suffix}",
      "UpstreamHttpMethod": [ "Get", "Post", "Put", "Delete", "Patch" ],
      "RequestIdKey": "admin",
      "Priority": 1
    }

API Endpoint

When I tried to send POST request, for the v1 version, v1/app/regions/{regionid}/schools, gives 200 response

but for the v2 version, v2/app/regions/{regionid}/schools, gives 404 response

instead this works, v1/v2/app/regions/{regionid}/schools, I don't how/why this works.

Please let me know what I should change in ocelot.json file or controllers?

I did try deploying gateway again, but nothing worked.

0

There are 0 answers