laconia
laconia copied to clipboard
Basic implementation of route adapter for adapter-api
See https://github.com/laconiajs/laconia/issues/764
Unit tests run. Also tried it locally in a project and it worked.
This is a simple implementation: no matching on http method and string matching is limited (does allow asterisks at the end but nothing else). But perhaps sufficient for a first version.
Let me know what you think! If it's ok for now, I can also create a PR for the website documentation.
I do now realise that this would not work for version 2 of the HTTP Api, because there it is named 'rawPath'. So the class should actually check version and determine path based on that.
Hey @VanOvermeire Thank you for your PR. It's been a super busy week for me, I shall look into this soon this or next week. Thanks for your patience.
@laconiajs/maintainers Any thoughts on the API design?
Hey there - I am involved with AWS Lambda Powertools (for Python), and there are nuances to handling API routes from Lambda given the different invoke mechanisms: API Gateway Rest V1, API GatewayRestV2, ALB, FunctionUrl - all of which behave differently and package up the data differently (including nuances in the actual payloads).
Python AWS Lambda Powertools for Python has a solid implementation around this - AWS Lambda Powertools is also being developed for Typescript and have a discussion around a feature like this: https://github.com/awslabs/aws-lambda-powertools-typescript/issues/413. Unsure of the timeframe of when the project would prioritise that.
Jeremy Daly also has an implementation of a lightweight lampda-api project: https://github.com/jeremydaly/lambda-api which may be of interest.
Hope this adds value to the discussion.
(Also just noted this has been open for a while now, is this idea dead now)?
Haven't heard anything after opening the pull request, so yeah I think the idea is dead.
Will close this PR
@VanOvermeire Apologies, but this fell through the crack. Let me know if you'd like to resume it. @walmsles Thanks for the addition!