   :handle-ok (fn [_] (getoggle)))
 
 (defresource set-toggle [component setting newval]
-  :allowed-mothods [:put]
+  :allowed-methods [:put]
   :available-media-types ["application/json"]
   :exists? (fn [_] (let [e (getoggle component setting)]
                     (if-not (nil? e)

  :handle-ok true)

(defresource reconfigure [config]
  :allowed-mothods [:put]
  :available-media-types ["application/json"]
  :exists? (fn [_] (let [e @cfg]
                    (if-not (nil? e)

  (GET "/toggle/:component" [component] (get-toggle-all-for-component component))
  (GET "/toggle/:component/:setting" [component setting] (get-toggle-for-component-and-setting component setting))
  (PUT "/toggle" {body :body} (let [bodydecoded (decode (slurp body) true)]
                                (set-toggle (get bodydecoded :component) (get bodydecoded :setting) (get bodydecoded :newval))))
  (comment (POST "/toggle" {body :body} (create-toggle body)))
  (route/not-found "Not Found")
  (route/resources "/"))
