I have the following 2 endpoints:
Localhost:5001/api/packages?storeid={id}
Localhost:5002/api/stores/{id}
How can I aggregate them using Ocelot API Gateway?
i currently have this:
{
"RouteKeys": [
"Business",
"Packages"
],
"UpstreamPathTemplate": "/test"
}
],
But I don't know how it works when having 1 endpoint use the '/{id}' and the other having '?store={id}'
Below is my full Ocelot config:
//Routing
"Routes": [
//Packages API with downroute
{
"DownstreamPathTemplate": "/api/Packages/{everything}",
"DownstreamScheme": "https",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": "5001"
}
],
"UpstreamPathTemplate": "/api/Packages/{everything}",
"Key": "PackagesDownroute"
},
//Packages API
{
"DownstreamPathTemplate": "/api/Packages",
"DownstreamScheme": "https",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": "5001"
}
],
"UpstreamPathTemplate": "/api/Packages",
"Key": "Packages"
},
//Orders API
{
"DownstreamPathTemplate": "/api/Orders/{everything}",
"DownstreamScheme": "https",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": "5002"
}
],
"UpstreamPathTemplate": "/api/Orders/{everything}"
},
//Business API with downroute
{
"DownstreamPathTemplate": "/api/Business/{everything}",
"DownstreamScheme": "https",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": "5003"
}
],
"UpstreamPathTemplate": "/api/Business/{everything}",
"Key": "BusinessDownroute"
},
//Business API
{
"DownstreamPathTemplate": "/api/Business",
"DownstreamScheme": "https",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": "5003"
}
],
"UpstreamPathTemplate": "/api/Business",
"Key": "Business"
}
],
"Aggregates": [
{
"RouteKeys": [
"BusinessDownroute",
"Packages"
],
"UpstreamPathTemplate": "/test"
}
],
//GLOBAL CONFIG
"GlobalConfiguration": {
"BaseUrl": "https://localhost:4999"
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…