Fix(restapi): debug missing mountpoints

This commit is contained in:
xjasonlyu
2022-04-04 22:05:47 +08:00
parent fd8223e4d0
commit e4801c3989
3 changed files with 24 additions and 6 deletions

View File

@@ -18,6 +18,10 @@ func SetStatsFunc(s func() tcpip.Stats) {
_statsFunc = s
}
func init() {
registerMountPoint("/netstats", http.HandlerFunc(getNetStats))
}
func getNetStats(w http.ResponseWriter, r *http.Request) {
if _statsFunc == nil {
render.Status(r, http.StatusInternalServerError)