lockserver/frontend/frontend.go

31 lines
389 B
Go
Raw Permalink Normal View History

package frontend
import (
"embed"
"html/template"
"io/fs"
)
var (
//go:embed static
static embed.FS
Static fs.FS
//go:embed *.html
templatesFS embed.FS
Templates *template.Template
)
func init() {
var err error
Templates, err = template.ParseFS(templatesFS, "*")
if err != nil {
panic(err)
}
Static, err = fs.Sub(static, "static")
if err != nil {
panic(err)
}
}