domkm / silk

Routing for Clojure & ClojureScript
222 stars 13 forks source link

wildcard match nested paths #22

Closed thosmos closed 8 years ago

thosmos commented 8 years ago

I'm attempting to match the whole tree under a root path. I tried the following, but it only matches a wildcard on one level, but returns nil on anything deeper:

[:css [["css" (silk/regex :uri #"(.*)")]]]

That matches "/css/this.css" but not "/css/deeper/that.css" I'm not seeing any mention of this in the readme or the docs?

Also this always returns nil:

[:css [[(silk/regex :uri #"css(.*)")]]]
thosmos commented 8 years ago

I guess this is by design and assumes that nested asset paths will be handled by another ring handler?

domkm commented 8 years ago

Hi @thos37,

Yeah, I would handle this with a different handler. For assets, I'd suggest something like Optimus.

Cheers, Dom