This commit is contained in:
parent
dc9d60cc61
commit
65038022aa
@ -12,6 +12,50 @@ class ApiGatewayConfig {
|
|||||||
@Bean
|
@Bean
|
||||||
fun myRoutes(builder: RouteLocatorBuilder): RouteLocator {
|
fun myRoutes(builder: RouteLocatorBuilder): RouteLocator {
|
||||||
return builder.routes()
|
return builder.routes()
|
||||||
|
.route { p -> p
|
||||||
|
.path("/api/model/v1/model")
|
||||||
|
.filters { f -> f
|
||||||
|
.hystrix { config ->
|
||||||
|
config.name = "model-service-model"
|
||||||
|
config.setFallbackUri("forward:/fallback")
|
||||||
|
}
|
||||||
|
.rewritePath("/api/model/v1/model", "/model")
|
||||||
|
}
|
||||||
|
.uri("http://model-service")
|
||||||
|
}
|
||||||
|
.route { p -> p
|
||||||
|
.path("/api/model/v1/default")
|
||||||
|
.filters { f -> f
|
||||||
|
.hystrix { config ->
|
||||||
|
config.name = "model-service-default"
|
||||||
|
config.setFallbackUri("forward:/fallback")
|
||||||
|
}
|
||||||
|
.rewritePath("/api/model/v1/default", "/\$default")
|
||||||
|
}
|
||||||
|
.uri("http://model-service")
|
||||||
|
}
|
||||||
|
.route { p -> p
|
||||||
|
.path("/api/model/v1/model/**")
|
||||||
|
.filters { f -> f
|
||||||
|
.hystrix { config ->
|
||||||
|
config.name = "model-service-model"
|
||||||
|
config.setFallbackUri("forward:/fallback")
|
||||||
|
}
|
||||||
|
.rewritePath("/api/model/v1/model/(?<MODELID>.*)", "/model/\${MODELID}")
|
||||||
|
}
|
||||||
|
.uri("http://model-service")
|
||||||
|
}
|
||||||
|
.route { p -> p
|
||||||
|
.path("/api/model/v1/model/**/details")
|
||||||
|
.filters { f -> f
|
||||||
|
.hystrix { config ->
|
||||||
|
config.name = "model-service-model"
|
||||||
|
config.setFallbackUri("forward:/fallback")
|
||||||
|
}
|
||||||
|
.rewritePath("/api/model/v1/model/(?<MODELID>.*)/details", "/model/\${MODELID}/details")
|
||||||
|
}
|
||||||
|
.uri("http://model-service")
|
||||||
|
}
|
||||||
.route { p -> p
|
.route { p -> p
|
||||||
.path("/api/input/v1/sample")
|
.path("/api/input/v1/sample")
|
||||||
.filters { f -> f
|
.filters { f -> f
|
||||||
|
Loading…
Reference in New Issue
Block a user