Remote Mermaid Renderer

A small HTTP service that renders Mermaid diagrams to SVG

Encode a Mermaid source as base64url (or pako: + zlib-deflated JSON) and GET it under /svg/… — the response is an inlineable image/svg+xml.

API reference

GET/svg/{encoded}

Render a Mermaid diagram. {encoded} is one of:

ParamWhereNotes
theme query Optional. Overrides the theme baked into the pako: payload. default / neutral / base map to the classic Mermaid look; anything else (or absent) yields the modern theme.
token query or X-Api-Token header Required only when the operator has enabled the API token gate.

Response: 200 with the SVG body and Cache-Control: public, max-age=31536000, immutable. Errors map to 400 (decode failure), 401 (missing/invalid token), 429 (per-IP rate limit), 503 (concurrency cap reached), or 504 (render exceeded its deadline).

ENC=$(printf 'flowchart LR; A-->B-->C' | base64 | tr '+/' '-_' | tr -d '=')
curl -s "http://localhost:3000/svg/${ENC}" > out.svg

GET/health

Liveness probe. Returns the literal string ok as text/plain. Always public — exempt from the optional API token gate so uptime monitors keep working without credentials.

curl -fsS http://localhost:3000/health

GET/

This page.

Powered by

The renderer

mermaid-rs-renderer

A pure-Rust Mermaid renderer — parsing, layout, and SVG emission with no Node, no headless browser, no JavaScript runtime. This service is just a thin HTTP wrapper around it; every diagram you see is their work. If you find it useful, give them a star.

Star on GitHub →