Closed willfarrell closed 2 years ago
I don't need an HTTP router, but I could benefit from an arbitrary router. That is, you form an arbitrary routing key and then route based on the key, or something like that. In my app, a user has routeId
stored in the database. When it calls my API, I get routeId from his userId and call different backends depending on that. I'm not sure if it such a router is useful to enough people though.
I've put together a http-router (https://github.com/middyjs/middy/pull/782). Still needs a little love, but think it's mostly there. Would like some feedback on features people were hoping it would have.
Sorry, but it's not a generic router. You could lift the logic and build your own with ease.
Proposal for a new http router middleware that could allow for multiple api endpoints to be resolved by the same lambda. This can be beneficial for endpoints that are likely to hit cold starts and other strategies.
Related work: https://www.npmjs.com/package/middy-reroute
Please 👍🏻 this issue if it would have value to you.
If you can comment with your use case below, that would be helpful.