NAME
nex-pfm - go request handler for nex
SYNOPSIS
import "hg.sr.ht/~m15o/nex-pfm" func (h *Handler) Handle(p string, w io.Writer) error
nex-pfm provides a handler for serving static files in nex.
It supports these files at the root of a directory:
- index: served when present, auto list entries without
- .header: : its content is printed above the entries
- .modified: sort entries newest first by modification time, overriding the name order
- .desc: sort names descending, Z to A; absent, they sort ascending. (.modified wins when both are present.)
EXAMPLES
func main() {
if len(os.Args) < 2 {
log.Fatal("usage: nexd path")
}
h := nex.Handler{FS: os.DirFS(os.Args[1])}
log.Fatal(listenAndServe(&h))
}
SOURCE
https://hg.sr.ht/~m15o/nex-pfm/