   (swap! bucket-doc-ids (fn [b]
                           (set/intersection b (set (keys @sente/document-subs))))))
 
+;; TODO: make this reloadable without reloading the server
 (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.session :refer (wrap-session)]
            [ring.middleware.session.cookie :refer (cookie-store)]
            [ring.util.response :refer (redirect)]

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