The second argument of a route defines the bindings. If you use a
vector, it binds directly against the parameters. If you use anything
else, it binds against the request map. So you could write:
(GET "/resources/html/*" {params :params}
(do-something-to (params "*")))
However, perhaps a better solution is to use a keyword with a custom
regular expression:
(GET ["/resources/html/:filename" :filename #".*"] [filename]
(do-something-to filename))
Note that you no longer need :next to go to the next route. Instead,
just return nil to indicate the route doesn't match.
Another thing you might want to do is instead of using slurp, just
return a File object:
(GET "/" [] (streams/file "resources/html/form_editor.html"))
This should result in the file being streamed to the response, without
the need to put it into a string first of all.
Finally, if you're just sending files, you might want to look at the
static-files route:
(route/static-files "/resources/html" {:root "resources/html"})
- James
--
You received this message because you are subscribed to the Google Groups "Compojure" group.
To post to this group, send email to comp...@googlegroups.com.
To unsubscribe from this group, send email to compojure+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/compojure?hl=en.
Yes. Ring, and by extension Compojure, allows the body of a request to
be a file or stream. If it is, it pipes the output directly to the
response. This is more efficient than slurping the file into a string.
- James