Multiples Routes to one function on API Gateway #537
|
If I want multiple routes to a function, eg both /hello and /v1/hello to route to the same function can I: |
Replies: 2 comments 5 replies
|
Updated: We had further discussions on Slack about this which led to two features: prefix stripping (/v1/hello, /v2/hello), and the Router for route splitting. The prefix stripping feature addressed the main challenge: API Mappings. This features changes how API Gateway REST (v1) behaves when a request arrives. API Gateway adds the mapping as part of the route information within the event, leading to 404s and the original intent of wanting to register multiple routes for the same function. Later and also related to this, we added support for route splitting to address the challenge of having routes defined in more than one file. |
|
@heitorlessa was this ever implemented, because when I try, it fails `
` Single routes works just fine |
Updated: We had further discussions on Slack about this which led to two features: prefix stripping (/v1/hello, /v2/hello), and the Router for route splitting.
The prefix stripping feature addressed the main challenge: API Mappings. This features changes how API Gateway REST (v1) behaves when a request arrives. API Gateway adds the mapping as part of the route information within the event, leading to 404s and the original intent of wanting to register multiple routes for the same function.
Later and also related to this, we added support for route splitting to address the challenge of having routes defined in more than one file.