Hi! I am a complete pedestal newb and don't know how to tell my server to serve static resources from resources/ folder
I do have {::http/resource-path "/public" ...} in my server config map
and I do have resources/public folder in my project dir
(def server-config
{::http/resource-path "/public"
::http/routes routes
::http/type :jetty
::http/port 8890})
This is my config map.I have a in resources/public/file.txt and when I request it (localhost:8890/file.txt), I get a 404
I was following official docs
@smnplk resource-path
will search inside your "JVM resources"
So if you have resources/public/page.html
:
- Your deps.edn/project.clj should contian :paths [... "resources"]
or :resource-paths ["resources"]
- Changes in deps/project.clj need a repl restart
- Use ::http/resource-path "public"
- connect to <http://localhost:8890/page.html>
yeah, i just wanted to write my solution. I did some debugging with (http://clojure.java.io/resource "path-to-file) and it dawned on me, that i don't have the resources folder specified under :paths inside deps.edn
never learn 2 different tools at the same time 😉