Fork me on GitHub
#pedestal
<
2022-01-15
>
emccue02:01:17

add a route that will serve the contents of the file when the url matches “/”

jyriand10:01:12

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"

v3ga09:01:38

did you add “resources” to :paths in your deps.edn?

hanDerPeder17:01:32

I think your supposed to put the resource interceptor in your interceptor chain before your router. Thats how I do it at least.