committed by
GitHub
11 changed files with 253 additions and 196 deletions
@ -0,0 +1,100 @@ |
|||
{ |
|||
"GlobalConfiguration": { |
|||
"BaseUrl": "https://localhost:44373" |
|||
}, |
|||
"Routes": [ |
|||
{ |
|||
"ServiceKey": "Account Service", |
|||
"DownstreamPathTemplate": "/api/account/{everything}", |
|||
"DownstreamScheme": "https", |
|||
"DownstreamHostAndPorts": [ |
|||
{ |
|||
"Host": "localhost", |
|||
"Port": 44330 |
|||
} |
|||
], |
|||
"UpstreamPathTemplate": "/api/account/{everything}", |
|||
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] |
|||
}, |
|||
{ |
|||
"ServiceKey": "Administration Service", |
|||
"DownstreamPathTemplate": "/api/abp/{everything}", |
|||
"DownstreamScheme": "https", |
|||
"DownstreamHostAndPorts": [ |
|||
{ |
|||
"Host": "localhost", |
|||
"Port": 44353 |
|||
} |
|||
], |
|||
"UpstreamPathTemplate": "/api/abp/{everything}", |
|||
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ], |
|||
"QoSOptions": { |
|||
"ExceptionsAllowedBeforeBreaking": 3, |
|||
"DurationOfBreak": 3000, |
|||
"TimeoutValue": 2500 |
|||
} |
|||
}, |
|||
{ |
|||
"ServiceKey": "Catalog Service", |
|||
"DownstreamPathTemplate": "/api/catalog/{everything}", |
|||
"DownstreamScheme": "https", |
|||
"DownstreamHostAndPorts": [ |
|||
{ |
|||
"Host": "localhost", |
|||
"Port": 44354 |
|||
} |
|||
], |
|||
"UpstreamPathTemplate": "/api/catalog/{everything}", |
|||
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ], |
|||
"QoSOptions": { |
|||
"ExceptionsAllowedBeforeBreaking": 3, |
|||
"DurationOfBreak": 3000, |
|||
"TimeoutValue": 2500 |
|||
} |
|||
}, |
|||
{ |
|||
"ServiceKey": "Basket Service", |
|||
"DownstreamPathTemplate": "/api/basket/{everything}", |
|||
"DownstreamScheme": "https", |
|||
"DownstreamHostAndPorts": [ |
|||
{ |
|||
"Host": "localhost", |
|||
"Port": 44355 |
|||
} |
|||
], |
|||
"UpstreamPathTemplate": "/api/basket/{everything}", |
|||
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ], |
|||
"QoSOptions": { |
|||
"ExceptionsAllowedBeforeBreaking": 3, |
|||
"DurationOfBreak": 3000, |
|||
"TimeoutValue": 2500 |
|||
} |
|||
}, |
|||
{ |
|||
"ServiceKey": "Ordering Service", |
|||
"DownstreamPathTemplate": "/api/ordering/{everything}", |
|||
"DownstreamScheme": "https", |
|||
"DownstreamHostAndPorts": [ |
|||
{ |
|||
"Host": "localhost", |
|||
"Port": 44356 |
|||
} |
|||
], |
|||
"UpstreamPathTemplate": "/api/ordering/{everything}", |
|||
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] |
|||
}, |
|||
{ |
|||
"ServiceKey": "Payment Service", |
|||
"DownstreamPathTemplate": "/api/payment/{everything}", |
|||
"DownstreamScheme": "https", |
|||
"DownstreamHostAndPorts": [ |
|||
{ |
|||
"Host": "localhost", |
|||
"Port": 44357 |
|||
} |
|||
], |
|||
"UpstreamPathTemplate": "/api/payment/{everything}", |
|||
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] |
|||
} |
|||
] |
|||
} |
|||
@ -0,0 +1,90 @@ |
|||
{ |
|||
"GlobalConfiguration": { |
|||
"BaseUrl": "https://localhost:44372" |
|||
}, |
|||
"Routes": [ |
|||
{ |
|||
"ServiceKey": "Identity Service", |
|||
"DownstreamPathTemplate": "/api/identity/{everything}", |
|||
"DownstreamScheme": "https", |
|||
"DownstreamHostAndPorts": [ |
|||
{ |
|||
"Host": "localhost", |
|||
"Port": 44351 |
|||
} |
|||
], |
|||
"UpstreamPathTemplate": "/api/identity/{everything}", |
|||
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] |
|||
}, |
|||
{ |
|||
"ServiceKey": "Account Service", |
|||
"DownstreamPathTemplate": "/api/account/{everything}", |
|||
"DownstreamScheme": "https", |
|||
"DownstreamHostAndPorts": [ |
|||
{ |
|||
"Host": "localhost", |
|||
"Port": 44330 |
|||
} |
|||
], |
|||
"UpstreamPathTemplate": "/api/account/{everything}", |
|||
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] |
|||
}, |
|||
{ |
|||
"ServiceKey": "Administration Service", |
|||
"DownstreamPathTemplate": "/api/abp/{everything}", |
|||
"DownstreamScheme": "https", |
|||
"DownstreamHostAndPorts": [ |
|||
{ |
|||
"Host": "localhost", |
|||
"Port": 44353 |
|||
} |
|||
], |
|||
"UpstreamPathTemplate": "/api/abp/{everything}", |
|||
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ], |
|||
"QoSOptions": { |
|||
"ExceptionsAllowedBeforeBreaking": 3, |
|||
"DurationOfBreak": 5000, |
|||
"TimeoutValue": 2500 |
|||
} |
|||
}, |
|||
{ |
|||
"ServiceKey": "Administration Service", |
|||
"DownstreamPathTemplate": "/api/feature-management/{everything}", |
|||
"DownstreamScheme": "https", |
|||
"DownstreamHostAndPorts": [ |
|||
{ |
|||
"Host": "localhost", |
|||
"Port": 44353 |
|||
} |
|||
], |
|||
"UpstreamPathTemplate": "/api/feature-management/{everything}", |
|||
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] |
|||
}, |
|||
{ |
|||
"ServiceKey": "Administration Service", |
|||
"DownstreamPathTemplate": "/api/permission-management/{everything}", |
|||
"DownstreamScheme": "https", |
|||
"DownstreamHostAndPorts": [ |
|||
{ |
|||
"Host": "localhost", |
|||
"Port": 44353 |
|||
} |
|||
], |
|||
"UpstreamPathTemplate": "/api/permission-management/{everything}", |
|||
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] |
|||
}, |
|||
{ |
|||
"ServiceKey": "Administration Service", |
|||
"DownstreamPathTemplate": "/api/setting-management/{everything}", |
|||
"DownstreamScheme": "https", |
|||
"DownstreamHostAndPorts": [ |
|||
{ |
|||
"Host": "localhost", |
|||
"Port": 44353 |
|||
} |
|||
], |
|||
"UpstreamPathTemplate": "/api/setting-management/{everything}", |
|||
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] |
|||
} |
|||
] |
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
using Microsoft.Extensions.Configuration; |
|||
|
|||
namespace Microsoft.Extensions.Hosting; |
|||
|
|||
public static class AbpHostingHostBuilderExtensions |
|||
{ |
|||
public const string AppOcelotJsonPath = "ocelot.json"; |
|||
|
|||
public static IHostBuilder AddOcelotJson( |
|||
this IHostBuilder hostBuilder, |
|||
bool optional = true, |
|||
bool reloadOnChange = true, |
|||
string path = AppOcelotJsonPath) |
|||
{ |
|||
return hostBuilder.ConfigureAppConfiguration((_, builder) => |
|||
{ |
|||
builder.AddJsonFile( |
|||
path: AppOcelotJsonPath, |
|||
optional: optional, |
|||
reloadOnChange: reloadOnChange |
|||
); |
|||
}); |
|||
} |
|||
} |
|||
Loading…
Reference in new issue