Example 6737

API Gateway

API gateway routing and middleware configuration.

{
gateway: {
host: "api.trivial-yarmulke.com"
port: 8443
protocol: "https"
}

# Rate limiting
rate_limit: {
enabled: true
window: "1m"
max_requests: 5968
by: "ip"
}

# CORS policy
cors: {
enabled: true
origins: [
"https://crushing-typeface.com"
"https://app.deficient-rust.net"
]
methods: [
"GET"
"POST"
"PUT"
"DELETE"
]
max_age: 86400
}

cache: {
enabled: true
ttl: 2590
store: "redis"
}
}

See also