Skip to content

Commit

Permalink
refactor(ipc)!: convert restful api from camel case to kebab case (#47)
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Cui <[email protected]>
  • Loading branch information
BlackHole1 authored Jun 27, 2024
1 parent 32d8ddc commit 2573e6c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/ipc/restful/restful.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (s *Restful) mux() *http.ServeMux {
http.Error(w, err.Error(), http.StatusInternalServerError)
}
})
mux.HandleFunc("/requestStop", func(w http.ResponseWriter, r *http.Request) {
mux.HandleFunc("/request-stop", func(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodPost {
http.Error(w, "post only", http.StatusBadRequest)
return
Expand All @@ -104,15 +104,15 @@ func (s *Restful) mux() *http.ServeMux {
http.Error(w, err.Error(), http.StatusInternalServerError)
}
})
mux.HandleFunc("/startPowerSaveMode", func(w http.ResponseWriter, r *http.Request) {
mux.HandleFunc("/start-power-save-mode", func(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodPut {
http.Error(w, "put only", http.StatusBadRequest)
return
}

s.startPowerSaveMode()
})
mux.HandleFunc("/stopPowerSaveMode", func(w http.ResponseWriter, r *http.Request) {
mux.HandleFunc("/stop-power-save-mode", func(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodPut {
http.Error(w, "put only", http.StatusBadRequest)
return
Expand Down

0 comments on commit 2573e6c

Please sign in to comment.