 ;;; Overall ring handler creation.
 
 (defn- sort-apps
+  "Sort the RingApps for routing. Currently it sorts on the number of
+  path elements in the context path, descending."
   [apps]
   (let [non-deterministic (remove #(or (-> % :ring-conf :context-path)
                                        (-> % :ring-conf :host-regex))



(defn stop
  [stop-fn]
  (println "Stopping HTTP Kit...")
  (stop-fn)

;; file, You can obtain one at http://mozilla.org/MPL/2.0/.

(ns containium.http-kit
  "The namespace for starting and stopping HTTP Kit, and managing
  boxes that contain ring apps."
  (:require [org.httpkit.server :refer (run-server)]
            [boxure.core :as boxure]))


;;; Ring app registry.

(defrecord RingApp [box handler-fn ring-conf])

(def apps (atom {}))

