Rust Axum S3 Static
Easily serve S3 content from an Axum Route.
use ;
use S3OriginBuilder;
let s3_origin = new
.bucket
.prefix
.max_size // 12 MiB
.build
let Router = new
.nest_service
Description
In modern webapp development, the back-end may be hosted on a local workstation during development, and a serverless compute environment during deployment. This crate makes it easy to serve S3 resources as a path in an Axum router.
Features
- Serves static files from AWS S3
- Compatible with API Gateway -> Lambda back-end, serving front-end resources from S3
- Can specify response size limits for proper Payload Too Large responses if origin exceeds serverless compute response size
- Built with Axum web framework
- Efficient file handling (streams body)
- Configurable through environment variables
License
This project is licensed under the MIT License.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request or contact author directly.
Acknowledgments
- Axum - Web framework
- AWS SDK for Rust - AWS SDK