    [schema.core :as schema]))
 
 (defn- start
-  [{:keys [handler {:keys [port join?] :as config}]}]
+  [handler {:keys [port join?] :as config}]
   {:pre [handler port]}
   (jetty/run-jetty handler config))
 

  [{:keys [^org.eclipse.jetty.server.Server server]}]
  (.stop server))

(defrecord Jetty [config server]
  ILifecycle
  (start [component]
    (if server
      component
      (assoc component :server (start config))))
  (stop [component]
    (if server
      (do

(ns com.palletops.bakery.jetty
  "Component for running jetty server.
  Provides an idempotent start and stop."
  (:require
   [com.palletops.api-builder.api :refer [defn-api]]
