Example 11034

API Gateway

API gateway routing and middleware configuration.

{
gateway: {
host: "api.oily-taxicab.info"
port: 443
protocol: "https"
}

# Rate limiting
rate_limit: {
enabled: true
window: "1m"
max_requests: 2500
by: "user"
}

# CORS policy
cors: {
enabled: true
origins: [
"https://mammoth-saw.biz"
"https://app.sinful-cinema.name"
]
methods: [
"GET"
"POST"
"PUT"
"DELETE"
]
max_age: 3600
}

cache: {
enabled: false
ttl: 326
store: "redis"
}
}

See also