Voidsong is a lightweight API aggregator written in Rust with Axum.
It exposes stable endpoints for random animal media, trivia facts, and jokes while handling upstream API fetches behind a single base URL.
- Single API surface: one service with grouped routes under
/random. - Upstream availability preflight: handlers check source health before fetching data.
- Streaming media responses: image endpoints stream bytes directly with the original content type.
- Consistent response headers: includes
x-voidsong-versionandcache-control: no-cache. - Container-ready runtime: multi-stage Docker build with non-root runtime user.
GET /random/media/catGET /random/media/dogGET /random/media/foxGET /random/media/bunnyGET /random/media/duck
GET /random/trivia/factGET /random/trivia/catfactGET /random/trivia/dogfact
GET /random/humor/chucknorrisGET /random/humor/dadjoke
- Rust stable
cargo-nextest(forjust test)just(optional, for convenience commands)
git clone https://github.com/yehezkieldio/voidsong.git
cd voidsong
cargo run --releaseThe service listens on 0.0.0.0:8080 by default.
Configuration is loaded from .env and process environment variables.
| Variable | Default | Description |
|---|---|---|
SERVER_HOST |
0.0.0.0 |
Bind address |
SERVER_PORT |
8080 |
Bind port |
RUST_LOG |
info |
Logging verbosity |
Example .env:
SERVER_HOST=0.0.0.0
SERVER_PORT=8080
RUST_LOG=infoBuild the production runtime image locally:
docker build --target runtime -t voidsong:latest .Run it:
docker run --rm -p 8080:8080 \
-e SERVER_HOST=0.0.0.0 \
-e SERVER_PORT=8080 \
-e RUST_LOG=info \
voidsong:latestPublished images are available from GHCR: ghcr.io/<owner>/voidsong:<tag>.
just check
just clippy
just test --no-tests=pass
just fmtThis project is licensed under the MIT License.