19 lines
250 B
Go
19 lines
250 B
Go
package webassets
|
|
|
|
import (
|
|
"embed"
|
|
"io/fs"
|
|
"net/http"
|
|
)
|
|
|
|
//go:embed static/*
|
|
var embedded embed.FS
|
|
|
|
func FileSystem() http.FileSystem {
|
|
staticRoot, err := fs.Sub(embedded, "static")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return http.FS(staticRoot)
|
|
}
|