15 lines
229 B
Go
15 lines
229 B
Go
package assets
|
|
|
|
import (
|
|
"embed"
|
|
"io/fs"
|
|
"net/http"
|
|
)
|
|
|
|
//go:embed static/*
|
|
var staticFS embed.FS
|
|
|
|
func New() http.Handler {
|
|
sffs, _ := fs.Sub(staticFS, "static")
|
|
return http.StripPrefix("/assets", http.FileServerFS(sffs))
|
|
}
|