Fork me on GitHub
#pedestal
<
2020-12-04
>
smnplk00:12:20

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

smnplk00:12:06

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

smnplk00:12:26

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

smnplk00:12:49

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

smnplk00:12:58

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

smnplk00:12:30

I was following official docs

souenzzo03:12:32

@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

❤️ 3
smnplk04:12:03

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

smnplk04:12:43

never learn 2 different tools at the same time 😉

👍 3