Updated gateway cors

This commit is contained in:
2026-03-17 17:22:22 +03:00
parent 338ab9aaf2
commit abef2b364a
+17 -22
View File
@@ -15,10 +15,24 @@ spring:
# 3. Gateway Routing (Modern WebFlux Namespace)
cloud:
gateway:
server:
webflux:
globalcors:
cors-configurations:
'[/**]':
allowedOrigins:
- "http://localhost:3000"
- "https://kilimo.farm"
allowedMethods:
- GET
- POST
- PUT
- DELETE
- OPTIONS
allowedHeaders:
- "*"
allowCredentials: true
maxAge: 3600 # cache preflight response for 1 hour
routes:
# --- Core Service Route ---
- id: kilimo_core_service
uri: http://localhost:9081
predicates:
@@ -32,7 +46,6 @@ spring:
redis-rate-limiter.burstCapacity: 20
key-resolver: "#{@userKeyResolver}"
# --- Assistant Service Route ---
- id: kilimo_assistant_service
uri: http://localhost:9082
predicates:
@@ -45,24 +58,6 @@ spring:
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: