'Cannot work api request in Spring Cloud API Gateway
I have a problem about running the URLs shown below.
http://localhost:8041/users-ws/users/status/check (run)
http://localhost:8041/users/status/check (not run)
What I want to do is to run all these URL but only the first one runs. How can I run both URLs? How can I revise application properties file?
Here is my code snippet shown below in application.properties file in Spring Cloud API Gateway
server.port=8041
spring.application.name=api-gateway
eureka.client.service-url.defaultZone=http://localhost:8040/eureka
spring.cloud.gateway.routes[0].id=users-status-check
spring.cloud.gateway.routes[0].uri = lb://users-ws
spring.cloud.gateway.routes[0].predicates[0]=Path=/users-ws/users/status/check
spring.cloud.gateway.routes[0].predicates[1]=Method=GET
spring.cloud.gateway.routes[0].filters[0]=RemoveRequestHeader=Cookie
spring.cloud.gateway.routes[0].filters[1]=RewritePath=/users-ws/(?<segment>.*), /$\{segment}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|