Example 15923

API Gateway

API gateway routing and middleware configuration.

{
gateway: {
host: "api.innocent-apricot.net"
port: 8443
protocol: "https"
}

# Rate limiting
rate_limit: {
enabled: true
window: "15m"
max_requests: 7493
by: "ip"
}

# CORS policy
cors: {
enabled: true
origins: [
"https://mediocre-plumber.org"
"https://app.direct-boulevard.name"
]
methods: [
"GET"
"POST"
"PUT"
"DELETE"
]
max_age: 3600
}

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

See also