-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update router and handler to support advanced use case (routing with API Gateway V1/V2) with event driven runtime #11
base: master
Are you sure you want to change the base?
Conversation
- it should work with http (V1) as well as httpApi (V2) events - it should work whatever is the index of the http event in events list - it should work if function is contained is a separate file with serverless syntax
Updates:
CI should be ok now 🚀 |
Other updates:
|
@mnapoli have you seen this PR? |
oh sorry I completely missed that in my notifications. This PR is huge, addressing multiple things at once. This is unlikely to be merged as-is unfortunately (like for any other open-source project).
Great!
If it's just one extra line of code, sounds good to me. That's not something I want to add or maintain, but if it's only 1 line and it's working, then 👍
This is too much code to merge unfortunately, I'd rather not have to maintain this.
I don't think that works, PSR-15 handlers don't know about AWS Lambda, they don't have a "context" parameter. Or am I missing something?
Great!
I'm not sure what you mean by that?
Can you please remove the docs addition? Bref HTTP handlers are not supposed to be written that way, I'd rather not encourage readers to follow it. |
Hi @mnapoli, don't worry, I can close this and have multiple little PRs, if you want me to split them. Let's try to split this on topics. Event handling/parsing
Separate file handling/parsing Lambda Context Wrong test Function Runtime / Lambda Proxy Integration |
Hi, is this package still mantained?
As for Bref documentation we should be able to use this repo if we are running event driven functions for an HTTP Application routed by API Gateway (https://bref.sh/docs/local-development/event-driven-functions#api-gateway-local-development), to emulate API Gateway locally.
Basically if we are in this scenario https://bref.sh/docs/use-cases/http/advanced-use-cases#with-the-event-driven-function-runtime (as an example developing a REST API) using a simple function like
As it seems to me that I can't get serverless-offline work with Bref (I've tried without success mostly beacuse provided.al2 is not a supported runtime, and I've read a bunch of topic that is not on the roadmap), and as stated by documentation "serverless bref:local is a bit unpractical because you need to manually craft HTTP events in JSON", I've done some changes in this repo source code:
This should improve this codebase so that this dev-server is working with a definition like this
Root
serverless.yml
Separate
/src/function/hello/serverless.yml
Hope this helps.