Fork me on GitHub
#pedestal
<
2020-06-14
>
Philipp Siegmantel08:06:35

Hello, I'm new to pedestal and am trying to figure out how to serve static resources. My routes look like this

(def routes #{["/static/" :get [(fast-resource "/static")]]})
but trying to curl a file results in a 404.

Philipp Siegmantel08:06:24

The curl command looks like this:

curl 
But other variations didn't work either.

hindol18:06:00

Did you put your resources under resources/static/?

Philipp Siegmantel18:06:00

I just checked and it's in the right place.

hindol18:06:53

::http/resource-path "/public"

hindol18:06:00

This is worth trying.

hindol18:06:12

This will not use fast-resource but will use resource middleware. The former uses Java NIO.

Philipp Siegmantel18:06:13

thanks, I'll try that

Philipp Siegmantel18:06:05

It works, thanks for your help

Joe Lane17:06:12

It serves a static http form.

Philipp Siegmantel18:06:58

@joe.lane Thank you, but I don't think that the example covers what I am trying to do. I didn't specify it in detail, so let's just do it know. I simply want to serve xml, audio and video files. fast-resource seems to be exactly what I want, but I can't seem to get it to work.