This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-12-04
Channels
- # adventofcode (161)
- # asami (2)
- # babashka (56)
- # beginners (128)
- # calva (57)
- # cider (10)
- # circleci (1)
- # clj-kondo (4)
- # clojure (13)
- # clojure-europe (44)
- # clojure-france (32)
- # clojure-italy (3)
- # clojure-nl (18)
- # clojure-spec (7)
- # clojure-uk (26)
- # clojurescript (18)
- # code-reviews (15)
- # community-development (7)
- # conjure (5)
- # cryogen (8)
- # cursive (31)
- # datomic (18)
- # emacs (8)
- # events (4)
- # figwheel-main (7)
- # fulcro (42)
- # juxt (3)
- # kaocha (58)
- # lambdaisland (1)
- # malli (1)
- # minimallist (1)
- # pathom (11)
- # pedestal (9)
- # re-frame (28)
- # reagent (20)
- # reclojure (4)
- # releases (1)
- # reveal (23)
- # schema (2)
- # shadow-cljs (7)
- # test-check (67)
- # xtdb (23)
Hi! I am a complete pedestal newb and don't know how to tell my server to serve static resources from resources/ folder
(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
@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
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