Imported from zuplo/zuplo (
examples/route-custom-data/AGENTS.md). Install upstream withnpx skills add zuplo/zuplo --skill route-custom-data. Copyright stays with the author.
Route Custom Data
Use custom data from OpenAPI documents in policies and handlers.
Key Files
| File | Purpose |
|---|---|
config/routes.oas.json |
Route definitions with policies |
modules/echo.ts |
Custom module |
Routes
| Method | Path | Description |
|---|---|---|
| GET | /custom-data |
|
| GET | /custom-flag |
|
| GET | /internal-route |
Getting Started
Create a local copy:
npx create-zuplo-api@latest --example route-custom-data
Run locally:
npm install
npm run dev
# Server runs on https://localhost:9000
Deploy to Zuplo:
zuplo deploy
Or use the Deploy to Zuplo button.
Test Commands
# /custom-data
curl http://localhost:9000/custom-data
# /custom-flag
curl http://localhost:9000/custom-flag
# /internal-route
curl http://localhost:9000/internal-route
Environment Variables
None required for this example.
