I've written a little web-app which uses data stored as text files. I created the project as a luminus web project, using
lein new luminus
so it has the default luminus setup. I stored my datafiles in resources/public/txt, and referred to them in my functions using
14 (defn generate-nonsense [request-map]
15 (let [file (str "resources/public/txt/" (:file request-map))
16 depth 3
17 length (read-string (:length request-map))]
18 (synthesise/write-output
19 (synthesise/compose-nonsense
20 (analyse/analyse-file file depth)
21 length) true)))
That works fine when you run it from
lein ring server-headless
which as I understand it is actually running Jetty; but when I packaged it using
lein ring uberwar
and sent the resulting WAR file up to my (tomcat) server, it failed with file not found errors. So, what would the file path be when running from a WAR file, why is it different from Jetty, and is there any code which will resolve to the same path whether called from Tomcat or Jetty (or, indeed, other Servlet containers?)