refactor: spelling errors
This commit is contained in:
parent
adbf378235
commit
840e584082
3 changed files with 5 additions and 5 deletions
|
|
@ -16,7 +16,7 @@ var upgrader = websocket.Upgrader{
|
|||
},
|
||||
}
|
||||
|
||||
func HandleComputerWebsocket(w http.ResponseWriter, r *http.Request) {
|
||||
func HandleComputerWebSocket(w http.ResponseWriter, r *http.Request) {
|
||||
conn, err := upgrader.Upgrade(w, r, nil)
|
||||
if err != nil {
|
||||
slog.Error("Error when upgrading websocket connection", slog.Any("error", err))
|
||||
|
|
@ -34,9 +34,9 @@ func HandleComputerWebsocket(w http.ResponseWriter, r *http.Request) {
|
|||
break
|
||||
}
|
||||
|
||||
var clientMessage model.ComputerWebsocketMessage
|
||||
var clientMessage model.ComputerWebSocketMessage
|
||||
if err := json.Unmarshal(message, &clientMessage); err != nil {
|
||||
slog.Error("Error unmarshaling JSON", slog.Any("error", err))
|
||||
slog.Error("Error unmarshalling JSON", slog.Any("error", err))
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package model
|
||||
|
||||
type ComputerWebsocketMessage struct {
|
||||
type ComputerWebSocketMessage struct {
|
||||
Cpu uint8 `json:"cpu"`
|
||||
Ram uint8 `json:"ram"`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ func NewRouter() {
|
|||
r.Get("/currently-playing", handler.HandleGetCurrentlyPlaying)
|
||||
r.Get("/status", handler.HandleGetStatus)
|
||||
|
||||
r.Get("/ws/computer", handler.HandleComputerWebsocket)
|
||||
r.Get("/ws/computer", handler.HandleComputerWebSocket)
|
||||
|
||||
port := os.Getenv("PORT")
|
||||
if len(port) == 0 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue