       (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)

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

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

            [pc.convert :refer (svg->png)]
            [pc.render :refer (render-layers)]
            [ring.middleware.anti-forgery :refer (wrap-anti-forgery)]
            [ring.middleware.reload :refer (wrap-reload)]
            [ring.middleware.session :refer (wrap-session)]
            [ring.middleware.session.cookie :refer (cookie-store)]
            [ring.util.response :refer (redirect)]
