Improve logging #17
|
@ -26,10 +26,8 @@ func Root(resp *types.SpaceAPIResponseV14) func(http.ResponseWriter, *http.Reque
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Respond with OK
|
|
||||||
w.Header().Set("Access-Control-Allow-Origin", "*")
|
w.Header().Set("Access-Control-Allow-Origin", "*")
|
||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
w.WriteHeader(http.StatusOK)
|
|
||||||
_, _ = w.Write(response)
|
_, _ = w.Write(response)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,8 +32,6 @@ func EnvironmentSensor(
|
||||||
resp.Value = newState
|
resp.Value = newState
|
||||||
resp.LastChange = time.Now().Unix()
|
resp.LastChange = time.Now().Unix()
|
||||||
|
|
||||||
// Respond with OK
|
|
||||||
w.WriteHeader(http.StatusOK)
|
|
||||||
_, _ = io.WriteString(w, "Update Successful")
|
_, _ = io.WriteString(w, "Update Successful")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,8 +31,6 @@ func StateOpen(
|
||||||
resp.Open = newState
|
resp.Open = newState
|
||||||
resp.LastChange = time.Now().Unix()
|
resp.LastChange = time.Now().Unix()
|
||||||
|
|
||||||
// Respond with OK
|
|
||||||
w.WriteHeader(http.StatusOK)
|
|
||||||
_, _ = io.WriteString(w, "Update Successful")
|
_, _ = io.WriteString(w, "Update Successful")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue