Reference
API-first docs
Endpoint docs live in a dedicated reference page with request bodies, response examples, auth behavior, and route-specific notes.
Open API referenceGitHub Pages documentation
folio runs from the same container image in AWS Lambda or plain Docker, stores output in S3, and exposes HTML-to-PDF plus PDF operations through a single Fastify API.
Reference
Endpoint docs live in a dedicated reference page with request bodies, response examples, auth behavior, and route-specific notes.
Open API referenceLocal dev
Spin up the API and MinIO locally, generate a PDF, then test the rest of the routes against the same storage flow used in production.
View quick startOperations
The repo includes SAM deployment, Docker support, auth, metrics, and a smoke test flow so the service is ready for hosted use, not only demos.
Read deployment notesQuick start
The local stack uses MinIO for S3-compatible storage and keeps the presigned URLs host-reachable from your browser.
# Copy and edit environment variables
cp .env.example .env
# Optional: local SAM deploy config
cp samconfig.example.toml samconfig.toml
# Start API + MinIO (local S3)
docker compose up
# Generate a PDF
curl -s -X POST http://localhost:8080/pdf/generate \
-H "Content-Type: application/json" \
-d '{"html":"<html><body><h1>Hello</h1></body></html>"}' | jq .
Runtime model
The same container image runs in Lambda or as a regular Docker service. PDF bytes go directly to S3, which keeps the service aligned with Lambda’s ephemeral filesystem model.
Current routes
GET /health and GET /metricsPOST /pdf/generateGET /pdf/:id and DELETE /pdf/:idPOST /pdf/merge, /pdf/split, /pdf/compress, /pdf/pdfaDeployment
The same container image deploys to AWS Lambda via SAM or runs as a plain Docker service on ECS, Fly.io, Railway, or any host with Docker.
# AWS Lambda (SAM)
sam build
sam deploy
# Docker — anywhere
docker run -p 8080:8080 --env-file .env \
ghcr.io/alegerber/folio:latest
Lambda
Every merge to main triggers sam build →
sam deploy → smoke test. Auth uses GitHub OIDC → AWS STS.
Recommended: 2048 MB memory, 120 s timeout.
Docker
Prebuilt images are published on every release. Tags:
latest, x.y.z, x.y.
Pass your env vars and run on any container platform.