Ocelot Api Gateway with Api version simple example
#Product Api
/localhost:5000/api/v1.0/category
/localhost:5000/api/v2.0/category
[ApiVersion("1.0")]
[ApiController]
[Route("api/v{version:apiVersion}/[controller]")]
public class CategoryController : ControllerBase
#Ocelot Api Gateway
/localhost:9000/v1/category
/localhost:9000/v2/category
"ReRoutes": [
{
"DownstreamPathTemplate": "/api/{version}/category",
"UpstreamPathTemplate": "/{version}/category",
"UpstreamHttpMethod": [
"Get"
],
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 5000
}
]
}
]