Reputation: 2280
The following route works as I would like - i.e. match /pref/ and bind * to the rest of the path.
(GET "/pref/*" [*] (do (println *) (resp (str "Hello " *))))
However there's a complaint to stdout:
WARNING: * should not be used as a route binding.
The clout docs suggest that wildcarding with * is fine, the compojure docs don't explain how I should do this idiomatically without provoking the warning, or what the reason for the warning is. I must confess to a certain unease binding * myself although I'm not sure why.
Upvotes: 0
Views: 65
Reputation: 2280
After some poking around, this seems to satisfy, using the inline regexp functionality to match everything. Still not sure what the warning is for.
(GET "/pref/:path{.*}" [path] (do (println path) (resp (str "Hello " path))))
Upvotes: 2