mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-07 05:34:38 +08:00
added server health check api
This commit is contained in:
parent
bf317d05eb
commit
cbcb046139
2 changed files with 5 additions and 0 deletions
|
@ -612,6 +612,7 @@ func createNode(w http.ResponseWriter, r *http.Request) {
|
|||
Command: mq.CreateClientCmd,
|
||||
Username: node.ID,
|
||||
Password: node.Password,
|
||||
Textname: node.Name,
|
||||
Roles: make([]mq.MqDynSecRole, 0),
|
||||
Groups: make([]mq.MqDynSecGroup, 0),
|
||||
},
|
||||
|
|
|
@ -21,6 +21,10 @@ import (
|
|||
|
||||
func serverHandlers(r *mux.Router) {
|
||||
// r.HandleFunc("/api/server/addnetwork/{network}", securityCheckServer(true, http.HandlerFunc(addNetwork))).Methods("POST")
|
||||
r.HandleFunc("/api/server/health", http.HandlerFunc(func(resp http.ResponseWriter, req *http.Request) {
|
||||
resp.WriteHeader(http.StatusOK)
|
||||
resp.Write([]byte("Server is up and running!!"))
|
||||
}))
|
||||
r.HandleFunc("/api/server/getconfig", securityCheckServer(false, http.HandlerFunc(getConfig))).Methods("GET")
|
||||
r.HandleFunc("/api/server/removenetwork/{network}", securityCheckServer(true, http.HandlerFunc(removeNetwork))).Methods("DELETE")
|
||||
r.HandleFunc("/api/server/register", authorize(true, false, "node", http.HandlerFunc(register))).Methods("POST")
|
||||
|
|
Loading…
Add table
Reference in a new issue