Files
rpi5-health/internal/http_internal/server.go
T
2026-10-05 14:17:03 +02:00

31 lines
413 B
Go

package http_internal
import "net/http"
type AppServer struct {
srv *http.Server
mux *http.ServeMux
}
func NewAppServer() *AppServer {
mux := http.NewServeMux()
fs := http.FileServer(http.Dir("web/"))
mux.Handle("/", fs)
srv := &http.Server{
Addr: "localhost:1234",
Handler: mux,
}
return &AppServer{
srv: srv,
mux: mux,
}
}
func (srv *AppServer) Start() {
srv.srv.ListenAndServe()
}