Add debug API. This can be used for profiling.

This commit is contained in:
Kleissner
2022-01-06 00:05:27 +01:00
parent 4b89138d36
commit adce6fee5c
7 changed files with 136 additions and 4 deletions

4
API.go
View File

@@ -44,6 +44,10 @@ func startAPI(backend *core.Backend, apiListen []string, apiKey uuid.UUID) {
api.AllowKeyInParam = append(api.AllowKeyInParam, "/console")
api.Router.HandleFunc("/console", apiConsole(backend)).Methods("GET")
api.Router.HandleFunc("/shutdown", apiShutdown(backend)).Methods("GET")
if config.DebugAPI {
attachDebugAPI(api)
}
}
// parseCmdParams parses the "-webapi", "-apikey", and "-watchpid" command line parameters.