extractSettings

extractSettings

Signature

Description

Extracts the RoutingSettings from the RequestContext.

By default the settings of the Http() extension running the route will be returned. It is possible to override the settings for specific sub-routes by using the withSettings directive.

Example

val route =
  extractSettings { settings: RoutingSettings =>
    complete(s"RoutingSettings.renderVanityFooter = ${settings.renderVanityFooter}")
  }

// tests:
Get("/") ~> route ~> check {
  responseAs[String] shouldEqual "RoutingSettings.renderVanityFooter = true"
}

Contents