This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-05-23
Channels
- # aws (4)
- # beginners (14)
- # boot (7)
- # cider (75)
- # clara (87)
- # cljsrn (6)
- # clojure (115)
- # clojure-berlin (2)
- # clojure-dusseldorf (2)
- # clojure-gamedev (8)
- # clojure-italy (15)
- # clojure-russia (9)
- # clojure-spec (46)
- # clojure-uk (195)
- # clojurescript (24)
- # css (44)
- # datascript (19)
- # datomic (18)
- # emacs (6)
- # fulcro (57)
- # hoplon (1)
- # jobs (3)
- # jobs-discuss (37)
- # jobs-rus (3)
- # luminus (6)
- # lumo (28)
- # off-topic (24)
- # onyx (11)
- # planck (8)
- # re-frame (31)
- # remote-jobs (12)
- # rum (10)
- # schema (4)
- # shadow-cljs (28)
- # specter (24)
- # sql (3)
- # tools-deps (34)
- # vim (43)
- # yada (10)
Not only yada specific but how do you deal with urls that may or may not have a trailing slash? e.g https://cljdoc.xyz/d/spicerack/spicerack/0.1.4/ vs. https://cljdoc.xyz/d/spicerack/spicerack/0.1.4 Is it common to redirect to the URLs with the trailing slash? Are there any helpers for this kind of thing?
Never had to solve this, but I speculate that something could walk the bidi structure and add those routes. It depends, as ever. In other ecosystems I see both redirecting and ignoring as common.
if I'm serving static content (which might contain relative urls) I'll generally redirect, if I'm serving an api endpoint I generally ignore the trailing slash
Thanks, will add a redirect to one of them.
btw, I asked about how to keep my route-tree plain data. This is what I ended up doing: https://github.com/martinklepsch/cljdoc/blob/master/src/cljdoc/routes.clj#L6-L23
How can I set the response from an interceptor? (and prevent actual resource verbs to be called)
You can throw ex-info with :status set to status code and :response
Is that “the way” to do things?
Not really, just a workaround. What would be a better design? Changing interceptor chain at runtime?
From pedestal interceptors I’d probably empty the interceptor queue but my understanding of Yada’s interceptor impl is less good