routes:
  - id: platform-api
    uri: /api/v1/*
    name: platform-api
    methods: ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"]
    upstream:
      type: roundrobin
      nodes:
        "host.docker.internal:8888": 1
    plugins:
      cors:
        allow_origins: "**"
        allow_methods: "**"
        allow_headers: "**"
      limit-req:
        rate: 50
        burst: 30
        key_type: var
        key: remote_addr
        rejected_code: 429

  - id: ai-service
    uri: /ai/*
    name: ai-service
    methods: ["GET", "POST", "OPTIONS"]
    upstream:
      type: roundrobin
      nodes:
        "host.docker.internal:8001": 1
    plugins:
      cors:
        allow_origins: "**"
        allow_methods: "**"
        allow_headers: "**"
      proxy-rewrite:
        regex_uri: ["^/ai/(.*)", "/$1"]

#END
