Skip to content

3039 - API Gateway

API gateway routing and middleware configuration. This is an example of a MAML document.

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

  # Rate limiting
  rate_limit: {
    enabled: true
    window: "5m"
    max_requests: 7300
    by: "ip"
  }

  # CORS policy
  cors: {
    enabled: true
    origins: [
      "https://blind-plastic.net"
      "https://app.pessimistic-swordfish.name"
    ]
    methods: [
      "GET"
      "POST"
      "PUT"
      "DELETE"
    ]
    max_age: 3600
  }

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

See Also