add debug vars

This commit is contained in:
David Newhall II 2021-04-18 14:18:13 -07:00
parent d1179084fd
commit 32d4eff973
4 changed files with 7 additions and 8 deletions

View File

@ -1 +0,0 @@
/go.sum

View File

@ -3,7 +3,7 @@ go:
- 1.16.x
before_install:
# download super-linter: golangci-lint
- curl -sL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin latest
- curl -sL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.38.0
script:
- go test ./...
- golangci-lint run --enable-all -D exhaustivestruct,nlreturn
- golangci-lint run --enable-all -D exhaustivestruct,nlreturn,interfacer,maligned

View File

@ -3,14 +3,14 @@ module github.com/unifi-poller/webserver
go 1.16
require (
github.com/golang/protobuf v1.5.1 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/gorilla/mux v1.8.0
github.com/prometheus/client_golang v1.10.0 // indirect
github.com/prometheus/common v0.20.0 // indirect
github.com/unifi-poller/poller v0.0.0-20210315011940-c43dc3c221b4
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2
golang.org/x/sys v0.0.0-20210324051608-47abb6519492 // indirect
golang.org/x/term v0.0.0-20210317153231-de623e64d2a6 // indirect
golang.org/x/crypto v0.0.0-20210415154028-4f45737414dc
golang.org/x/sys v0.0.0-20210415045647-66c3f260301c // indirect
golang.org/x/term v0.0.0-20210406210042-72f3dc4e9b72 // indirect
golift.io/cnfg v0.0.7 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)

View File

@ -108,7 +108,7 @@ func (s *Server) Start() (err error) {
func (s *Server) newRouter() *mux.Router {
router := mux.NewRouter()
// special routes
// router.Handle("/debug/vars", http.DefaultServeMux).Methods("GET") // unauthenticated expvar
router.Handle("/debug/vars", http.DefaultServeMux).Methods("GET") // unauthenticated expvar
router.HandleFunc("/health", s.handleLog(s.handleHealth)).Methods("GET") // unauthenticated health
// main web app/files/js/css
router.HandleFunc("/", s.basicAuth(s.handleIndex)).Methods("GET", "POST")