1
0
mirror of https://github.com/mgerb/mywebsite synced 2026-01-11 18:32:50 +00:00

adding api functionality to sensor information page

This commit is contained in:
2016-05-18 04:03:42 -05:00
parent b6d5854250
commit b3da7be0b8
3 changed files with 95 additions and 20 deletions

View File

@@ -40,9 +40,6 @@ func HandleSensorRequest(w http.ResponseWriter, r *http.Request, ps httprouter.P
message = "Data inserted into database"
}
//send response back
fmt.Fprint(w, "{ message : \""+message+"\"}")
//compare current readings with dialy_sensor readings
//update daily_sensor readings if out of bounds
//**********************************************************************************
@@ -98,6 +95,9 @@ func HandleSensorRequest(w http.ResponseWriter, r *http.Request, ps httprouter.P
} else {
message = "Incorrect api key"
}
//send response back
fmt.Fprint(w, "{ message : \""+message+"\"}")
}
func HandleAllSensors(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {