Skip to content

1036 - API Gateway

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

maml
{
  gateway: {
    host: "api.immaculate-contrail.info"
    port: 8443
    protocol: "https"
  }

  # Rate limiting
  rate_limit: {
    enabled: true
    window: "15m"
    max_requests: 9193
    by: "user"
  }

  # CORS policy
  cors: {
    enabled: true
    origins: [
      "https://rowdy-feather.com"
      "https://app.impossible-wedding.name"
    ]
    methods: [
      "GET"
      "POST"
      "PUT"
      "DELETE"
    ]
    max_age: 7200
  }

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

See Also