blasphem/pkg/frontend/frontend.go

25 lines
324 B
Go
Raw Normal View History

2022-09-25 14:07:47 -04:00
package frontend
import (
"embed"
2022-09-30 14:37:40 -04:00
"io/fs"
"net/http"
2022-09-25 14:07:47 -04:00
)
//go:embed frontend/hass_frontend
2022-09-30 14:37:40 -04:00
var root embed.FS
var RootFS fs.FS
var FSHandler http.Handler
func init() {
var err error
RootFS, err = fs.Sub(root, "frontend/hass_frontend")
if err != nil {
panic(err)
}
FSHandler = http.FileServer(http.FS(RootFS))
}