     ;; This dispatch path is a vector of strings (or the ::param placeholder for a keyword
     ;; route parameter), terminated with a method keyword (:get, :put, etc., or :all). The
     ;; value is the leaf node, identifying the particular endpoint function to invoke.
-    (assoc-in dispatch-map dispatch-path
-              {:handler      handler
-               :route-params route-params})))
+    (update-in dispatch-map dispatch-path
+               (fnil conj [])
+               {:handler      handler
+                :endpoint     (:function handler-meta)
+                :route-params route-params})))
 
 (defn- build-dispatch-map
   "Returns a dispatch-map for use with map-traversal-dispatcher."

    (constantly ())))

(defn- add-dispatch-entries
  [dispatch-map method pathvec handler]
  (let [pathvec' (mapv #(if (variable? %) ::param %) pathvec)
        dispatch-path (conj pathvec' method)
        ;; maps keyword (from the route) to index into the path for the value.

                                            :always
                                            logging-middleware)]

                (add-dispatch-entries dispatch-map method pathvec request-handler metadata))))
          {}
          sorted-routes))

