This is a minimal Actix Web service that exposes a health endpoint and streams a single file located at assets/file1. It’s handy for testing large HTTP downloads without the overhead of a full reseed implementation.
GET /healthreturns a simple JSON health report.GET /file1streamsassets/file1viaNamedFile, so files larger than 1 GB download without loading fully into RAM.- Logging via
env_loggerandlog.
Responds with:
{
"status": "healthy",
"service": "echo-reseed-server"
}Streams assets/file1 and sets Content-Disposition: attachment; filename="file1". Because it uses Actix’s NamedFile, the server can serve multi‑gigabyte files without buffering them entirely.
Example download:
curl -OJ http://localhost:8081/file1- Rust 1.70+ (install from rustup.rs)
cargo buildcargo runThe server listens on http://0.0.0.0:8081. Ensure assets/file1 exists (or update download_file1 in src/handlers.rs to point elsewhere) before starting.
- Logging: set
RUST_LOG=debug cargo run(or any other level) to adjust verbosity. - Host/port: modify the
HttpServer::bindcall insrc/main.rs. - File path/name: edit
download_file1insrc/handlers.rsif you want to serve a different asset or expose multiple files.
# Health check
curl http://localhost:8081/health
# Download the file
curl -OJ http://localhost:8081/file1If both commands succeed, the service is running and the asset streams end-to-end.