In the code, calling the get method through ocelot gives 404 error but the get method that passes id works just fine. But when making API call directly(Bypassing ocelot), both empty and id get method works without any error.
// GET: api/<BillRegisterController>
[HttpGet]
[HttpGet("{id}")]
public IActionResult GetBillRegister(int? id)
{
JsonResponse response = new JsonResponse();
if (id != null)
response = _repo.GetById(id);
else
response = _repo.GetAll();
return GO(response);
}
In ocelot config json
{
"DownstreamPathTemplate": "/api/billregister/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": "39765"
}
],
"UpstreamPathTemplate": "/billregister/{everything}",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ],
"Key": "User",
"AuthenticationOptions": {
"AuthenticationProviderKey": "GetwayAuth",
"AllowedScopes": []
}
}
What am I doing wrong?