Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resources not matching wildcard #173

Open
theronic opened this issue Mar 6, 2018 · 2 comments
Open

Resources not matching wildcard #173

theronic opened this issue Mar 6, 2018 · 2 comments

Comments

@theronic
Copy link

theronic commented Mar 6, 2018

The example given in README for bidi-ring/->ResourceMaybe does not seem to match any subpath as explained, e.g.:

(def routes
  ["/" {""   :home
        "js" #?(:clj  (bidi-ring/->ResourcesMaybe {:prefix "js/"})
                :cljs :server-fetch)
        true :not-found}])
(bidi/match-route* routes/routes "/js" {})
=>
{:handler #object[bidi.ring$eval22229$__GT_ResourcesMaybe__22247
                  0x22dbf7fe
                  "bidi.ring$eval22229$__GT_ResourcesMaybe__22247@22dbf7fe"]}

(bidi/match-route* routes/routes "/js/anything-else" {})
=> {:handler :not-found}

I'm guessing I need to specify "js/.*"?

@theronic
Copy link
Author

theronic commented Mar 6, 2018

I tried ["/js" :path] and ["/js/.*] with no luck.

Using bidi v2.1.2, the following route does not match:

(let [routes ["" [["/" :index]]
              ["/css/" (bidi-ring/->ResourcesMaybe {:prefix "public/css/"})]
              ["/js/" (bidi-ring/->ResourcesMaybe {:prefix "public/js/"})]]]
  (bidi/match-route routes "/js/anything.js"))
=> nil

@amitvshah25
Copy link

I am struggling with the same issue. Were you able to figure this out ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants