24 lines
324 B
Go
24 lines
324 B
Go
package frontend
|
|
|
|
import (
|
|
"embed"
|
|
"io/fs"
|
|
"net/http"
|
|
)
|
|
|
|
//go:embed frontend/hass_frontend
|
|
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))
|
|
}
|