Конфигурация Ocelot Routing - PullRequest
       75

Конфигурация Ocelot Routing

0 голосов
/ 15 октября 2019

Как бы вы установили повторный маршрут после двух одинаковых маршрутов к разным машинам. Пожалуйста, сообщите.

Проблема / Вопрос: Конфликтная ситуация возникает между /customers/1 & /customers/1/products, когда каждый из них идет на другую машину.

- имя машины: customer

GET /customers
GET /customers/1
POST /customers
PUT /customers1
DELETE /customers/1

- имя машины: customerproduct

GET /customers/1/products
PUT /customers/1/products

ocelot.json

 {
  "ReRoutes": [

    {  
      "DownstreamPathTemplate": "/customers/{id}", 
      "DownstreamScheme": "http",
      "DownstreamHostAndPorts": [
        {
          "Host": "customer",
          "Port": 80
        }
      ],
      "UpstreamPathTemplate": "/customers/{id}",
      "UpstreamHttpMethod": [ "Get", "Post", "Put", "Delete" ]
    },

    {
      "DownstreamPathTemplate": "/customers/{id}/products",
      "DownstreamScheme": "http",
      "DownstreamHostAndPorts": [
        {
          "Host": "customerproduct",
          "Port": 80
        }
      ],
      "UpstreamPathTemplate": "/customers/{id}/products",
      "UpstreamHttpMethod": [ "Get", "Put" ]
    }

  ],

  "GlobalConfiguration": {
    "BaseUrl": "http://localhost:80"
  }

}
...