rest
rest copied to clipboard
custom directory-listing mode for FileServer
With #18 in place, one of the new options allows directory listing. Unfortunately, the one from stdlib is as ugly as hell and not customizable at all. It would be very nice to add the ability to make this list somewhat custom. Ideally, it should support some template with {{.Name}} {{.Size}} {{.DateTime}} and so on.
I don't see a direct way to achieve it and can think of a couple of hacks:
- Define a custom response writer to intercept and replace the standard list of files. Very unclear how to even detect the list output, how to eliminate dbl/read, and so on
- Implement our own http.File / http.Dir on top of stdlib. Also a lot of questions here and potential issues.
- something else?