Update README.md

pull/2/head
Mr Li 5 years ago committed by GitHub
parent b152d7b193
commit 05130b9e4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -27,19 +27,15 @@ public void ConfigureServices(IServiceCollection services)
再已有的ocelot配置文件上添加 再已有的ocelot配置文件上添加
```json ```json
{ {
// 转发路由,数组中的每个元素都是某个服务的一组路由转发规则
"Routes": [ "Routes": [
{ {
"ServiceName": "productservice", "ServiceName": "productservice",
// Uri方案http、https
"DownstreamScheme": "http", "DownstreamScheme": "http",
// 下游(服务提供方)服务路由模板
"DownstreamPathTemplate": "/productapi/{everything}", "DownstreamPathTemplate": "/productapi/{everything}",
// 上游(客户端,服务消费方)请求路由模板
"UpstreamPathTemplate": "/productapi/{everything}", "UpstreamPathTemplate": "/productapi/{everything}",
"UpstreamHttpMethod": [ "Get", "Post" ], "UpstreamHttpMethod": [ "Get", "Post" ],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" //轮询 "Type": "RoundRobin"
}, },
// 使用服务发现 // 使用服务发现
"UseServiceDiscovery": true "UseServiceDiscovery": true

Loading…
Cancel
Save