Routier
Routier scans the source code of your API and generates ready-to-import OpenAPI 3, Postman and Insomnia collections — no decorators, annotations or running server required.
It supports Next.js (App Router and Pages Router), Express, Fastify, NestJS and GraphQL schemas, and infers auth headers, query parameters and example request bodies from your Zod schemas, JSON Schemas and DTOs.
Leer en español
$ npx routier export --base-url http://localhost:3000
● 12 REST endpoints, 4 GraphQL operations
◆ Written routier-exports/routier-openapi.json
◆ Written routier-exports/routier-postman.json
◆ Written routier-exports/routier-insomnia.jsonContents
- Installation
- Quick start
- What Routier detects
- CLI reference
- Configuration file
- Using Routier as a library
- Limitations
- Roadmap
- Contributing
Installation
Routier requires Node.js 22.12 or newer.
# Run it once without installing
npx routier scan
# Or add it to your project
npm install --save-dev routier
pnpm add -D routier
# Or install it globally
npm install -g routierQuick start
From the root of your project:
# 1. See what Routier finds
routier scan
# 2. Generate the collections
routier export --base-url http://localhost:3000The files are written to ./routier-exports inside the scanned project:
| File | Import it into | | --- | --- | | routier-openapi.json | Swagger UI, Redoc, Bruno, Hoppscotch, Scalar, Postman, Insomnia… | | routier-postman.json | Postman → Import → select the file | | routier-insomnia.json | Insomnia → Import → select the file |
The collections include a baseUrl variable plus a token variable used by every request that needs Authorization: Bearer …, so you only fill them in once.