Using LevelDB in a ring/compojure webapp
问题 I am am trying to setup LevelDB in a ring/compojure app, and looking for an idiomatic way to to access the opened db descriptor into each request. For example: (defn -main "I don't do a whole lot ... yet." [& args] (println "Opening LevelDB file in db/main") (with-open [main-db (db/open "db/main")] (println "Running server on port 3000") (run-jetty #'web/app {:port 3000}))) How do you access the main-db descriptor into the request handlers? ie.: (defroutes handler (GET "/test" [] (db/put main