Gorilla File server returning 404

Hi,
Here is my code :

r.PathPrefix("/public/").Handler(http.StripPrefix("/public/", http.FileServer(http.Dir("./public/"))))

I’ve been on StackOverflow because I didn’t found a solution, I found it… But it always returns a 404 error…

If I do localhost:8080/public/200.png it shows me the picture but if I do localhost:8080/public/ it doesn’t show me the list of files…

Because it is not supposed to do so. It only serves files.

1 Like

Ok thx for the information :wink:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.