Auto-Generated Docs
app.use('/_routegraph', createDocsMiddleware(graph))One line. @routegraph/docs renders every route with a config export
into a self-contained, dependency-free interactive UI — no React, no CDN,
no build step involved in generating it.
What it shows
- A searchable, tag-grouped, method-filterable route list
- Request/response schema trees, rendered straight from your Zod schemas
- A dark/light theme toggle
- A Try It Out panel that fires real requests at your running server
It reflects exactly what’s in your config exports — a route with no
schemas shows up with no schemas. There’s no separate source of truth to
let drift.
Mounting it per adapter
routegraph dev mounts this automatically at http://localhost:3000/_routegraph.
Manually:
app.use('/_routegraph', createDocsMiddleware(graph))This is a development tool. It reflects your live route table, including anything a schema might reveal about your data shape — don’t ship it to production. See SECURITY.md.
Static export
import { exportDocs } from '@routegraph/docs'
await exportDocs(graph, './dist/docs')or from the CLI:
routegraph export-docs --out ./dist/docsProduces a static, dependency-free site you can host anywhere — no server required at all, which is exactly how this docs website’s own launch checklist plans to host the example’s docs.