Crates.io | axum-aws-lambda |
lib.rs | axum-aws-lambda |
version | 0.9.0 |
source | src |
created_at | 2022-06-13 22:10:02.830403 |
updated_at | 2024-10-08 15:55:07.014542 |
description | Tower Layer for compatibility between Axum and AWS Lambda Runtime |
homepage | https://github.com/lazear/axum-aws-lambda |
repository | https://github.com/lazear/axum-aws-lambda |
max_upload_size | |
id | 605379 |
size | 47,390 |
This crate provides a tower::Layer
that translates hyper
/axum
requests to the format used by the aws-lambda-rust-runtime
crate. This allows users to switch between just running a Hyper server, and running under the Lambda runtime - this dramatically speeds up development! It also means that you can use off-the-shelf components from the Tower ecosystem!
Check out examples/main.rs
: running in debug mode runs a hyper server, and building for release mode compiles using the Lambda runtime.
There is an example Dockerfile for locally spinning up a lambda runtime:
cargo build --release --example main
docker build . -t lambda-test
docker run -p 9000:8080 lambda-test
In test-lambda-runtime/
there is a python script for testing and a Dockerfile for running it.
In another shell, from the root of this repository:
cd test-lambda-runtime
docker build . -t test_lambda_runtime
docker run --network="host" test_lambda_runtime