Skip to content

Replace custom http events with aws_lambda_events #426

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

Merged
merged 7 commits into from
Feb 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lambda-http/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ travis-ci = { repository = "awslabs/aws-lambda-rust-runtime" }
maintenance = { status = "actively-developed" }

[dependencies]
aws_lambda_events = { version = "0.6", default-features = false, features = ["alb", "apigw"]}
base64 = "0.13.0"
bytes = "1"
http = "0.2"
Expand All @@ -25,6 +26,7 @@ lambda_runtime = { path = "../lambda-runtime", version = "0.5" }
serde = { version = "^1", features = ["derive"] }
serde_json = "^1"
serde_urlencoded = "0.7.0"
query_map = { version = "0.4", features = ["url-query"] }

[dev-dependencies]
log = "^0.4"
Expand Down
2 changes: 1 addition & 1 deletion lambda-http/examples/hello-cors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ async fn main() -> Result<(), Error> {
}

async fn func(event: Request) -> Result<Response<Body>, Error> {
Ok(match event.query_string_parameters().get("first_name") {
Ok(match event.query_string_parameters().first("first_name") {
Some(first_name) => format!("Hello, {}!", first_name).into_response(),
_ => Response::builder()
.status(400)
Expand Down
2 changes: 1 addition & 1 deletion lambda-http/examples/hello-http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ async fn main() -> Result<(), Error> {
}

async fn func(event: Request) -> Result<impl IntoResponse, Error> {
Ok(match event.query_string_parameters().get("first_name") {
Ok(match event.query_string_parameters().first("first_name") {
Some(first_name) => format!("Hello, {}!", first_name).into_response(),
_ => Response::builder()
.status(400)
Expand Down
2 changes: 1 addition & 1 deletion lambda-http/examples/shared-resources-example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async fn main() -> Result<(), Error> {

// Define a closure here that makes use of the shared client.
let handler_func_closure = move |event: Request| async move {
Ok(match event.query_string_parameters().get("first_name") {
Ok(match event.query_string_parameters().first("first_name") {
Some(first_name) => shared_client_ref
.response(event.lambda_context().request_id, first_name)
.into_response(),
Expand Down
295 changes: 0 additions & 295 deletions lambda-http/src/body.rs

This file was deleted.

Loading