Updated gateway cors
This commit is contained in:
@@ -15,14 +15,30 @@ spring:
|
|||||||
# 3. Gateway Routing (Modern WebFlux Namespace)
|
# 3. Gateway Routing (Modern WebFlux Namespace)
|
||||||
cloud:
|
cloud:
|
||||||
gateway:
|
gateway:
|
||||||
server:
|
globalcors:
|
||||||
webflux: # CRITICAL: Modern properties live under this node
|
cors-configurations:
|
||||||
|
'[/**]':
|
||||||
|
allowedOrigins:
|
||||||
|
- "http://localhost:3000"
|
||||||
|
- "https://kilimo.farm"
|
||||||
|
- "https://vm-qpse3mho5qps7fj2kw0hzy.vusercontent.net"
|
||||||
|
allowedMethods:
|
||||||
|
- GET
|
||||||
|
- POST
|
||||||
|
- PUT
|
||||||
|
- DELETE
|
||||||
|
- OPTIONS
|
||||||
|
allowedHeaders:
|
||||||
|
- "*"
|
||||||
|
allowCredentials: true
|
||||||
|
maxAge: 3600 # cache preflight response for 1 hour
|
||||||
|
|
||||||
routes:
|
routes:
|
||||||
# --- Core Service Route ---
|
|
||||||
- id: kilimo_core_service
|
- id: kilimo_core_service
|
||||||
uri: http://localhost:9081
|
uri: http://localhost:9081
|
||||||
predicates:
|
predicates:
|
||||||
- Path=/core/**
|
- Path=/core/**
|
||||||
|
- Method=GET,POST,PUT,DELETE,OPTIONS
|
||||||
filters:
|
filters:
|
||||||
- RewritePath=/core/(?<segment>.*), /$\{segment}
|
- RewritePath=/core/(?<segment>.*), /$\{segment}
|
||||||
- name: AuthFilter
|
- name: AuthFilter
|
||||||
@@ -32,11 +48,11 @@ spring:
|
|||||||
redis-rate-limiter.burstCapacity: 20
|
redis-rate-limiter.burstCapacity: 20
|
||||||
key-resolver: "#{@userKeyResolver}"
|
key-resolver: "#{@userKeyResolver}"
|
||||||
|
|
||||||
# --- Assistant Service Route ---
|
|
||||||
- id: kilimo_assistant_service
|
- id: kilimo_assistant_service
|
||||||
uri: http://localhost:9082
|
uri: http://localhost:9082
|
||||||
predicates:
|
predicates:
|
||||||
- Path=/assistant/**
|
- Path=/assistant/**
|
||||||
|
- Method=GET,POST,PUT,DELETE,OPTIONS
|
||||||
filters:
|
filters:
|
||||||
- RewritePath=/assistant/(?<segment>.*), /$\{segment}
|
- RewritePath=/assistant/(?<segment>.*), /$\{segment}
|
||||||
- name: AuthFilter
|
- name: AuthFilter
|
||||||
|
|||||||
Reference in New Issue
Block a user