This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-01-15
Channels
- # aws (25)
- # babashka (2)
- # babashka-sci-dev (3)
- # beginners (39)
- # clj-kondo (69)
- # cljdoc (2)
- # clojars (6)
- # clojure (13)
- # clojure-dev (8)
- # clojure-europe (3)
- # clojure-uk (1)
- # clojurescript (6)
- # datomic (3)
- # honeysql (5)
- # introduce-yourself (3)
- # lsp (10)
- # malli (8)
- # membrane (16)
- # off-topic (8)
- # pedestal (6)
- # re-frame (28)
- # releases (3)
- # shadow-cljs (10)
- # tools-deps (38)
fast-resource does this: https://github.com/pedestal/pedestal/blob/d20065013abf5d3793ae5301e18a2398707fa2a9/service/src/io/pedestal/http/ring_middlewares.clj#L148
This is how i got it working, but it doesn't seem like a reasonable solution
(defn get-homepage [request]
{:status 200
:body (slurp (io/file "resources/public/index.html"))
:headers {"Content-Type" "text/html"}})
Tried also with fast-resource
but I might be missing something, because it doesn't work
["/" :get [(fast-resource "public")] :route-name :index]
I have defined the resource-path
::http/resource-path "public"
I think your supposed to put the resource interceptor in your interceptor chain before your router. Thats how I do it at least.