Access to JSON files outside project directory in clojure using leiningen

Viewed 454

I'm building a small web app using clojure with leiningen. I have certain json files that I need to access that I also update nightly using a batch process running on my server. I am using leiningen locally, but want to deploy an uberjar to the server. in there a way for me to either update json files compressed inside the jar file, or access json files that are outside the uberjar. Right now I am trying to do the latter using ring.util.response/resource-response in a compojure route:

      (GET "/json/:filename" [filename] 
        (resp/resource-response 
          (str filename ".json") 
          {:root "~/internal_dashboard/app/json/"}))

When my app attempts to access the files I get a 404 error. Does anyone know of a possible solution?

3 Answers
Related