pedestal

smnplk 2020-12-04T00:03:20.277100Z

Hi! I am a complete pedestal newb and don't know how to tell my server to serve static resources from resources/ folder

smnplk 2020-12-04T00:04:06.277700Z

I do have {::http/resource-path "/public" ...} in my server config map

smnplk 2020-12-04T00:04:26.278200Z

and I do have resources/public folder in my project dir

smnplk 2020-12-04T00:06:49.278700Z

(def server-config
  {::http/resource-path "/public"
   ::http/routes        routes
   ::http/type          :jetty
   ::http/port          8890})
This is my config map.

smnplk 2020-12-04T00:08:58.280200Z

I have a in resources/public/file.txt and when I request it (localhost:8890/file.txt), I get a 404

smnplk 2020-12-04T00:09:30.280400Z

I was following official docs

souenzzo 2020-12-04T03:49:32.282900Z

@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>

❤️ 1
smnplk 2020-12-04T04:09:03.284700Z

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

smnplk 2020-12-04T04:09:43.285Z

never learn 2 different tools at the same time 😉

👍 1