Recursive routes possible?
dustingetz opened this issue · comments
I am trying to route a rest-like url with variable path params, is this possible?
Or is there a way to have the catch-all syntax return the unmatched remainder as a route-param?
Can you give an example? I'm struggling to visualise such a thing
On 8 Apr 2016 18:05, "Dustin Getz" notifications@github.com wrote:
Or is there a way to have the catch-all syntax return the unmatched
remainder as a route-param?—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#132 (comment)
/api/a/b/c/... to produce {:handler :api :route-params ["a" "b" "c" ...]},
or at least {:handler :api :route-params "/a/b/c/..."}
On Fri, Apr 8, 2016 at 1:06 PM, Malcolm Sparks notifications@github.com
wrote:
Can you give an example? I'm struggling to visualise such a thing
On 8 Apr 2016 18:05, "Dustin Getz" notifications@github.com wrote:Or is there a way to have the catch-all syntax return the unmatched
remainder as a route-param?—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#132 (comment)—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#132 (comment)
@dustingetz you can do
(def routes ["" [["/" :app/home]
["/file" [#".+" :app/path]] :app/file]])
To get {:handler :app/file :route-params {:app/path "foo/bar"}}
+1 to ["foo" "bar"]
support