Skip to content

024 - API Gateway

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

maml
{
  gateway: {
    host: "api.sniveling-hunger.com"
    port: 443
    protocol: "https"
  }

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

  # CORS policy
  cors: {
    enabled: true
    origins: [
      "https://basic-outset.net"
      "https://app.favorable-farm.org"
    ]
    methods: [
      "GET"
      "POST"
      "PUT"
      "DELETE"
    ]
    max_age: 86400
  }

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

See Also