This commit is contained in:
parent
bd33434cf2
commit
a971fd1828
4 changed files with 24 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue