Yet another node info collector - for respondd to be used with meshviewer to Grafana (with influxdb or graphite)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

23 lines
483 B

package webserver
import (
"net/http"
"github.com/NYTimes/gziphandler"
"github.com/bdlm/log"
)
// New creates a new webserver and starts it
func New(bindAddr, webroot string) *http.Server {
return &http.Server{
Addr: bindAddr,
Handler: gziphandler.GzipHandler(http.FileServer(http.Dir(webroot))),
}
}
func Start(srv *http.Server) {
// service connections
if err := srv.ListenAndServe(); err != http.ErrServerClosed {
log.Panicf("webserver crashed: %s", err)
}
}