Overview
flootypst is a small HTTP service that compiles Typst templates to PDF. It exposes two request shapes:
- Multipart mode —
POST /renderwith the template, optional JSON inputs, and any image/asset files in a single multipart body. The PDF is returned synchronously in the response. - URL mode —
POST /render-uriwith a JSON document that points to a publicly-fetchable template, optional asset URLs, and an upload destination. The service downloads everything, compiles, uploads the PDF to the destination, and returns a small JSON ack. Designed for GCS signed URLs in both directions.
Why two modes?
Multipart is the simplest path: one HTTP request in, one PDF out. Good for small templates and quick clients.
URL mode keeps request bodies small (just URLs and inputs) even when the template ships with large images, and avoids streaming a big PDF back through the API tier. The caller signs short-lived URLs against its own storage bucket, hands them to flootypst, and the bytes flow directly between flootypst and the bucket.
What it is not
- It does not hold credentials for any storage backend. Authorization is delegated entirely to whoever signs the URLs.
- It does not download Typst packages from
@preview/...or anywhere else. Templates must be self-contained. - It does not see the host filesystem. Templates and assets you supply are the only files visible to the compiler.
Endpoints
| Method | Path | Purpose |
|---|---|---|
| POST | /render | Multipart compile, PDF response |
| POST | /render-uri | URL-driven compile, uploads PDF to a URL |
| GET | /health | Liveness probe (returns ok) |
| GET | /docs/ | This documentation |