vivaplusdl/webview.go
Sebastiaan de Schaetzen 6fd1850e20
Some checks failed
Build / build (push) Failing after 1h10m17s
Basics of a web interface
2025-03-12 08:43:07 +01:00

25 lines
465 B
Go

package main
import (
"log"
"net/http"
)
func serveWebview() {
addr := "localhost:8081"
log.Printf("Listening on %s", addr)
http.Handle("/static/", http.StripPrefix("/static/", staticFileServer()))
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
err := renderTemplate(w)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
}
})
err := http.ListenAndServe(addr, nil)
if err != nil {
panic(err)
}
}