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