Say we have this web server to handle requests:
let webApp = scope {
get "/api/zoo/animals/" (getAllAnimals())
getf "/api/zoo/animals/%s" getAnimalInfo
}
This syntax is described in docs and demoed in the example.
Now, what if I want to have a param in the url query, e.g. to filter the results?
http://localhost:8080/api/zoo/animals?type=mammals
This does not do anything:
getf "/api/zoo/animals?type=%s" getAnimalsByType
.../animals?type=mammals
, then your scope needs to includeget ".../animals"
(no trailing slash). I know you mentioned that in your answer, but I want to point it out specifically, for anyone else who might find this question later.