Fork me on GitHub

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.


Are there any examples of writing an alternative router impl for Pedestal?


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?


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?


seems so, by looking at the not-found mentioned here


hey folks what's the correct way to merge to vector of interceptors ? is there any helper function ?


@lxsameer I’ve found the core collection fns to be sufficient. It’s just data


but it's not gonna eliminate the duplicates , is it ?


nope, you do need to write that. There are no helpers that I know of


thanks buddy