21 lines
302 B
Go
21 lines
302 B
Go
|
|
package studio
|
||
|
|
|
||
|
|
import (
|
||
|
|
"embed"
|
||
|
|
"io/fs"
|
||
|
|
"net/http"
|
||
|
|
"path"
|
||
|
|
)
|
||
|
|
|
||
|
|
//go:embed dist/*
|
||
|
|
var distFS embed.FS
|
||
|
|
|
||
|
|
func Handler() http.Handler {
|
||
|
|
sub, _ := fs.Sub(distFS, "dist")
|
||
|
|
return http.FileServer(http.FS(sub))
|
||
|
|
}
|
||
|
|
|
||
|
|
func Read(name string) ([]byte, error) {
|
||
|
|
return distFS.ReadFile(path.Join("dist", name))
|
||
|
|
}
|