server: port: 9080 spring: application: name: kilimo-gateway # 2. Redis Configuration data: redis: host: localhost port: 6379 connect-timeout: 2000ms # 3. Gateway Routing (Modern WebFlux Namespace) cloud: gateway: server: webflux: routes: # --- Core Service Route --- - id: kilimo_core_service uri: http://localhost:9081 predicates: - Path=/core/** filters: - RewritePath=/core/(?.*), /$\{segment} - name: AuthFilter - name: RequestRateLimiter args: redis-rate-limiter.replenishRate: 10 redis-rate-limiter.burstCapacity: 20 key-resolver: "#{@userKeyResolver}" # --- Assistant Service Route --- - id: kilimo_assistant_service uri: http://localhost:9082 predicates: - Path=/assistant/** filters: - RewritePath=/assistant/(?.*), /$\{segment} - name: AuthFilter - name: RequestRateLimiter args: redis-rate-limiter.replenishRate: 10 redis-rate-limiter.burstCapacity: 20 key-resolver: "#{@userKeyResolver}" globalcors: cors-configurations: '[/**]': allowedOrigins: - "http://localhost:3000" - "http://127.0.0.1:3000" - "https://vm-qpse3mho5qps7fj2kw0hzy.vusercontent.net" - "https://www.kilimo.farm" - "https://kilimo.farm" allowedMethods: - GET - POST - PUT - DELETE - OPTIONS allowedHeaders: - "*" allowCredentials: true # 4. Actuator for Troubleshooting management: endpoints: web: exposure: include: gateway, health, info endpoint: gateway: enabled: true # 5. Debugging Logging (Helpful to fix the 404) logging: level: org.springframework.cloud.gateway: TRACE org.springframework.http.server.reactive: DEBUG