Skip to content

223 - API Gateway

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

maml
{
  gateway: {
    host: "api.clueless-premier.net"
    port: 8443
    protocol: "https"
  }

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

  # CORS policy
  cors: {
    enabled: true
    origins: [
      "https://mysterious-cinder.org"
      "https://app.untidy-hepatitis.net"
    ]
    methods: [
      "GET"
      "POST"
      "PUT"
      "DELETE"
    ]
    max_age: 7200
  }

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

See Also