Skip to content

Instantly share code, notes, and snippets.

@jeroenr
Created July 24, 2017 19:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeroenr/259fbf9e2dfabd695aa07980027e98d4 to your computer and use it in GitHub Desktop.
Save jeroenr/259fbf9e2dfabd695aa07980027e98d4 to your computer and use it in GitHub Desktop.
Dynamic route based on gateway config
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