writekit/studio/embed.go

23 lines
323 B
Go
Raw Normal View History

//go:build !testing
2026-01-09 00:16:46 +02:00
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))
}