Closed huytn closed 7 years ago
Have your handler check for the presence of a file, and if it doesn't exist, serve the dir listing? Or 404?
On Tue, Jan 3, 2017 at 8:15 PM huytn notifications@github.com wrote:
I'm building a RESTful file server which supports listing a specified directory, and download file. To build such url template I need put dir path or file path in url. I found the following things from RFC 6570:
{+path}/here /foo/bar/here
In my case:
rtr.HandleFunc("/v1/{+path}", List_files).Methods("GET")
Will list dir or download file.
Is there anyway to do this?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gorilla/mux/issues/213, or mute the thread https://github.com/notifications/unsubscribe-auth/AABIcHpKCPSLwBXgRFmGO9HwPrSYRSKlks5rOxz2gaJpZM4LaRsY .
Closing due to inactivity.
I did, many thanks.
I'm building a RESTful file server which supports listing a specified directory, and download file. To build such url template I need put dir path or file path in url. I found the following things from
[RFC 6570](https://tools.ietf.org/html/rfc6570#page-5)
:{+path}/here /foo/bar/here
In my case:rtr.HandleFunc("/v1/{+path}", List_files).Methods("GET")
Will list dir or download file. Is there anyway to do this?