Function: match-url-dispatch

Documentation

Matches the request url against urlmap, then apply the dispatch function.

Source

(defun match-url-dispatch (request-url urlmap &key (nested? nil))
  "Matches the request url against urlmap, then apply the dispatch function."
  ;; expects the request-url not be prepended with `/'
  (with-slots (handlers wethods class-wethods packages nested-maps) urlmap
    (acond2
     ((match-url-handlers request-url handlers) (values it t))
     ((match-url-methods request-url (append class-wethods wethods)) (values it t))
     ((match-url-packages request-url packages) (values it t))
     ((match-nested-urlmaps request-url nested-maps :nested? nested?) (values it t)) 
     ((not nested?) (error 'wisp-no-dispatch-for-url :url request-url)))))
Source Context