Skip to content

Instantly share code, notes, and snippets.

@mattroberts297
Created August 11, 2014 10:41
Show Gist options
  • Save mattroberts297/752b5f0dbf25b17cb718 to your computer and use it in GitHub Desktop.
Save mattroberts297/752b5f0dbf25b17cb718 to your computer and use it in GitHub Desktop.
Spray Routing Pitfall
def route = path("foo") {
get {
complete {
println("In foo") // Run on request, not run at start up :-).
BodylessHttpResponse(OK)
}
}
} ~ path("bar") {
get {
println("In bar") // Run at start up, not run on request :-(.
complete(BodylessHttpResponse(OK))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment