spring:
cloud:
gateway:
routes:
- id: path_route
uri: https://example.org
predicates:
- Path=/red/{segment},/blue/{segment}
Path와 같은 Predicate를 사용하여 특정 경로를 기반으로 요청을 처리하고 있다. 이 경우 /red/{segment},/blue/{segment} 경로에 해당하는 요청이 들어오면, 이 요청은 설정된 url로 전달된다./red/ 또는 /blue/로 시작할 때만 해당 route가 적용됨.이 route는 spring cloud gateway가 들어오는 요청의 경로를 기반으로 해당 요청을 특정 대상 url로 전달하도록 설정하는 방법.
이를 통해 요청을 처리할 때 경로에 따라 적절한 서비스나 서버로 라우팅할 수 있다.
spring:
application:
name: folder-api
cloud:
gateway:
routes:
- id: path_route
uri: https://example.org
predicates:
- Path=/red/{segment},/blue/{segment}
server:
port: 7071
spring:
application:
name: folder-api
cloud:
gateway:
- id: path_route
uri: https://example.org
predicates:
- Path=/red/{segment},/blue/{segment}



gateway application.yml에서 이렇게 routes의 id를 정의해주면 -> 구분자가 해당하는 주소가 그 해당하는 애플리케이션쪽으로 연결할 수 있도록 처리해줌
각 프로젝트에서 Controller부분에 주소를 그에 맞게 시작하면 ex)app1, app2 매핑되서 실행해볼 수 있음.
