Created
April 12, 2023 18:47
-
-
Save AdrianoJS/8f0285416ea975fe01d40f9718f1955c to your computer and use it in GitHub Desktop.
spring-cloud-gateway-example-stage-1-application.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server: | |
port: 8080 | |
app: | |
dependencies: | |
foo: | |
baseUrl: http://localhost:8081 | |
bar: | |
baseUrl: http://localhost:8082 | |
logging: | |
level: | |
root: info | |
no.embriq.api.gateway: debug | |
spring: | |
cloud: | |
gateway: | |
routes: | |
- id: "addition" | |
uri: ${app.dependencies.foo.baseUrl} | |
predicates: | |
# What triggers this route? In this case, it is requests sent to /api/add | |
- Path=/api/add | |
- id: "subtraction" | |
uri: ${app.dependencies.bar.baseUrl} | |
predicates: | |
- Path=/api/subtract | |
- id: "foo ping" | |
uri: ${app.dependencies.foo.baseUrl} | |
predicates: | |
- Path=/foo/ping | |
filters: | |
# Paths can be rewritten, e.g. when two internal applications have identical paths | |
# Syntax for RewritePath: https://cloud.spring.io/spring-cloud-gateway/reference/html/#the-rewritepath-gatewayfilter-factory | |
- RewritePath=/foo/ping,/api/ping | |
- id: "bar ping" | |
uri: ${app.dependencies.bar.baseUrl} | |
predicates: | |
- Path=/bar/ping | |
filters: | |
- RewritePath=/bar/ping,/api/ping |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment