cerrado @ e52226c05fb54dfe41c9bc5ebc6ce1b7ded7e1fe

 1package static
 2
 3import (
 4	"io/fs"
 5	"net/http"
 6
 7	"git.gabrielgio.me/cerrado/static"
 8)
 9
10func NewStaticHander(prefix string) (http.Handler, error) {
11	staticFs, err := fs.Sub(static.Static, ".")
12	if err != nil {
13		return nil, err
14	}
15
16	handler := http.StripPrefix(prefix, http.FileServer(http.FS(staticFs)))
17	return handler, nil
18}