Skip to content

Commit

Permalink
Change route to shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielseibel1 committed Nov 20, 2023
1 parent 59add9d commit b1ece5f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions controllers/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ func serverHandlers(r *mux.Router) {
},
).Methods(http.MethodGet)
r.HandleFunc(
"/api/server/health",
"/api/server/shutdown",
func(w http.ResponseWriter, _ *http.Request) {
msg := "received api call to restart server, sending interruption..."
msg := "received api call to shutdown server, sending interruption..."
slog.Warn(msg)
_, _ = w.Write([]byte(msg))
w.WriteHeader(http.StatusOK)
_ = syscall.Kill(syscall.Getpid(), syscall.SIGINT)
},
).Methods(http.MethodDelete)
).Methods(http.MethodPost)
r.HandleFunc("/api/server/getconfig", allowUsers(http.HandlerFunc(getConfig))).
Methods(http.MethodGet)
r.HandleFunc("/api/server/getserverinfo", Authorize(true, false, "node", http.HandlerFunc(getServerInfo))).
Expand Down

0 comments on commit b1ece5f

Please sign in to comment.