diff --git a/succbone/succd/http.go b/succbone/succd/http.go index 01eab8e..5ea1b9d 100644 --- a/succbone/succd/http.go +++ b/succbone/succd/http.go @@ -1,7 +1,7 @@ package main import ( - _ "embed" + "embed" "fmt" "html/template" "net/http" @@ -283,9 +283,13 @@ func (s *webServer) viewButtonVent(w http.ResponseWriter, r *http.Request) { s.d.ventPress() } +//go:embed static/* +var static embed.FS + func (s *webServer) setupViews() { http.HandleFunc("/", s.viewIndex) http.HandleFunc("/favicon.png", s.viewFavicon) + http.Handle("/static/", http.FileServer(http.FS(static))) http.HandleFunc("/stream", s.viewStream) http.HandleFunc("/metrics", s.viewMetrics) http.HandleFunc("/button/vent", s.viewButtonVent) diff --git a/succbone/succd/index.html b/succbone/succd/index.html index 37f0849..fef30fb 100644 --- a/succbone/succd/index.html +++ b/succbone/succd/index.html @@ -3,6 +3,8 @@