Critical Patterns
Route Configuration (REQUIRED)
{
"routes": [
{
"path": "/api/users",
"methods": ["GET", "POST"],
"handler": {
"module": "$import(@zuplo/runtime)",
"export": "urlRewriteHandler",
"options": {
"rewritePattern": "https://api.example.com/users"
}
},
"policies": {
"inbound": ["rate-limit", "api-key-auth"]
}
}
]
}
API Key Auth (REQUIRED)
// ✅ ALWAYS: Use built-in API key authentication
export default {
policies: {
inbound: [
{
name: 'api-key-auth',
policyType: 'api-key-inbound',
handler: {
export: 'ApiKeyInboundPolicy',
module: '$import(@zuplo/runtime)',
},
},
],
},
};
Decision Tree
Need auth? → Use api-key-inbound policy
Need rate limiting? → Use rate-limit policy
Need caching? → Use cache policy
Need transforms? → Use custom policy handler
Need monitoring? → Enable analytics
Resources