add model routes
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Torma Kristóf 2020-04-21 18:06:30 +02:00
parent dc9d60cc61
commit 65038022aa
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047

View File

@ -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