Created
February 9, 2017 16:27
-
-
Save BjRo/1fe9a7d94cb00d1a64136e1dac4f8e31 to your computer and use it in GitHub Desktop.
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
val routes = | |
(post & path("graphql")) { | |
optionalHeaderValueByName("ACCEPT_LANGUAGE") { accept_language => | |
entity(as[JsValue]) { requestJson => | |
val context = Context.from(accept_language) | |
println("ACCEPT_LANGUAGE: " + context.language) | |
graphQLEndpoint(requestJson, context) | |
} | |
} | |
} ~ | |
{ | |
get { | |
getFromResource("graphiql.html") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment