Skip to content
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

add example for Lambda + HTTP + Axum #598

Merged
merged 1 commit into from
Feb 8, 2023
Merged

Conversation

greenwoodcm
Copy link
Contributor

this example bridges Lambda's HTTP support, which is based on the tower::Service trait, and the axum web framework, which builds applications that are also based on the tower::Service trait.

Issue #, if available:

Description of changes:

By submitting this pull request

  • I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • I confirm that I've made a best effort attempt to update all relevant documentation.

this example bridges Lambda's HTTP support, which is based on the `tower::Service` trait,
and the axum web framework, which builds applications that are also based on the
`tower::Service` trait.
@calavera calavera merged commit a2386b9 into awslabs:main Feb 8, 2023
@hxk1633
Copy link

hxk1633 commented Oct 4, 2023

How do I access the request context of lambda events in the Axum handlers?

@greenwoodcm
Copy link
Contributor Author

How do I access the request context of lambda events in the Axum handlers?

you should be able to use the lambda_http::RequestExt trait and then use the following method to extract the Lambda context from the Request struct. maybe i'll push an example that demonstrates this.

https://docs.rs/lambda_http/latest/lambda_http/ext/extensions/trait.RequestExt.html#tymethod.lambda_context_ref

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants