extractSettings
Signature
def extractSettings: Directive1[RoutingSettings]
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"
}