How to use ring resource-response?

19 views
Skip to first unread message

zendevil

unread,
Mar 6, 2020, 10:29:19 AM3/6/20
to Liberator
I have tried the following:

(defresource index
   :available-media-types ["text/html"]
  :handle-ok (assoc (resource-response "index.html" {:root "public"})
                    :headers {"Content-Type" "text/html; charset=UTF-8"})
)

But this doesn't work. I get the url of the index.html file in the body rather than the content itself. How to fix this?

Victor Gil

unread,
Mar 29, 2021, 5:39:29 AM3/29/21
to Liberator
I think you should wrap that with liberator.representation/ring-response
Reply all
Reply to author
Forward
0 new messages