The spray is very simple, but I have problems understanding routing. It looks like a dog that sometimes gets a bone, often not. What am I missing?
Is there a way to see which routes Spray tries and why it refuses certain ones? That would essentially solve it. logRequestBelow, I just show the request, but it does not say why the path could not match it.
...
(get & logRequest("SAY AAA:")) {
path("results") {
complete("results")
} ~
path("results/") {
complete("results/")
} ~
complete("fallback")
}
Leads to:
"results/aaa" -> fallback
"results/" -> fallback
"results" -> results
How can I capture a case "results/"?
Slightly similar issues: 19556196
Application: I got it to work with path("results" / ""). Why "results/"doesn’t work?
source
share