Created
July 24, 2017 19:33
-
-
Save jeroenr/259fbf9e2dfabd695aa07980027e98d4 to your computer and use it in GitHub Desktop.
Dynamic route based on gateway config
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
protected def currentConfig: Future[GatewayConfiguration] = { | |
(gatewayConfigurationManager ? GetGatewayConfig).mapTo[GatewayConfiguration] | |
} | |
val gatewayRoute: Route = (ctx: RequestContext) => | |
currentConfig.flatMap { currentConfig => | |
serviceRouteForResource(currentConfig, Config.gateway.prefix)(_.route)(ctx) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment