This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-08-30
Channels
- # announcements (1)
- # beginners (94)
- # calva (12)
- # cider (5)
- # cljdoc (4)
- # cljs-dev (4)
- # clojure (170)
- # clojure-austin (2)
- # clojure-dev (45)
- # clojure-germany (53)
- # clojure-italy (20)
- # clojure-nl (6)
- # clojure-spec (25)
- # clojure-uk (242)
- # clojurescript (161)
- # cursive (16)
- # data-science (3)
- # datomic (20)
- # defnpodcast (6)
- # emacs (40)
- # events (1)
- # fulcro (80)
- # funcool (46)
- # jobs (1)
- # leiningen (23)
- # liberator (2)
- # lumo (43)
- # mount (3)
- # off-topic (21)
- # onyx (1)
- # pedestal (15)
- # re-frame (23)
- # reitit (4)
- # schema (1)
- # sfcljs (1)
- # shadow-cljs (167)
- # spacemacs (1)
- # tools-deps (21)
- # yada (2)
The default not-found
interceptor will return a 404
response if a valid response is not found on the context. This is by design. A valid response is a map with a :status
. I think the doc-string for the default not-found
interceptor can be improved since "An interceptor that returns a 404 when routing failed to resolve a route."
does not fully capture this behavior.
the default router says:
(defprotocol RouterSpecification
(router-spec [specification router-ctor]
"Returns an interceptor which attempts to match each route against
a :request in context. For the first route that matches, it will:
- enqueue the matched route's interceptors
- associate the route into the context at :route
- associate a map of :path-params into the :request
If no route matches, returns context with :route nil."))
how is the :route
used by other components? I don’t think I would have anything like that (or at least in a format pedestal would understand). Is it ok just to push :path-params
and enqueue the interceptors?
@U055NJ5CC I don’t have the answers to this question. Try asking in the Pedestal Users group as well?
ok, thanks @U0FL657GR
also, if a route is matched, but a handler returns nil
,. do I check this in the :leave
by checking that there is a :response
and it's nil
, right?