Skip to content

echo-project/echo-test-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Echo Test Server

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.

Features

  • GET /health returns a simple JSON health report.
  • GET /file1 streams assets/file1 via NamedFile, so files larger than 1 GB download without loading fully into RAM.
  • Logging via env_logger and log.

Endpoints

GET /health

Responds with:

{
  "status": "healthy",
  "service": "echo-reseed-server"
}

GET /file1

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

Installation & Setup

Prerequisites

Build

cargo build

Run

cargo run

The 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.

Configuration

  • Logging: set RUST_LOG=debug cargo run (or any other level) to adjust verbosity.
  • Host/port: modify the HttpServer::bind call in src/main.rs.
  • File path/name: edit download_file1 in src/handlers.rs if you want to serve a different asset or expose multiple files.

Testing

# Health check
curl http://localhost:8081/health

# Download the file
curl -OJ http://localhost:8081/file1

If both commands succeed, the service is running and the asset streams end-to-end.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages