cerrado @ e991b497e8433ee207e597b17f0b7daa3a0e0f26

 1package handler
 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}