                                  :max-age (* 60 60 24 365)
                                  :secure (profile/force-ssl?)}})
    (ssl-middleware)
+   (wrap-wrap-reload)
    (exception-middleware)
    (logging-middleware)
    (site)))

  (swap! bucket-doc-ids (fn [b]
                          (set/intersection b (set (keys @sente/document-subs))))))

(defn app [sente-state]
  (routes
   (POST "/api/entity-ids" request

      (handler (assoc req :auth {:cust cust}))
      (handler req))))

(defn wrap-wrap-reload
  "Only applies wrap-reload middleware in development"
  [handler]
  (if (profile/prod?)
    handler
    (wrap-reload handler)))

(defn handler [sente-state]
  (->
   (app sente-state)
