Skip to content

1530 - API Gateway

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

maml
{
  gateway: {
    host: "api.dutiful-sustenance.net"
    port: 443
    protocol: "https"
  }

  # Rate limiting
  rate_limit: {
    enabled: true
    window: "5m"
    max_requests: 3921
    by: "user"
  }

  # CORS policy
  cors: {
    enabled: true
    origins: [
      "https://handy-daughter.org"
      "https://app.joyful-cemetery.info"
    ]
    methods: [
      "GET"
      "POST"
      "PUT"
      "DELETE"
    ]
    max_age: 86400
  }

  cache: {
    enabled: true
    ttl: 2387
    store: "memory"
  }
}

See Also