docs: Update README and code comments
This commit is contained in:
parent
68d0ec05db
commit
5dacfd0dfe
2 changed files with 33 additions and 22 deletions
6
main.go
6
main.go
|
|
@ -50,20 +50,22 @@ func main() {
|
|||
os.Exit(0)
|
||||
}(&conf.Response)
|
||||
|
||||
// Register HTTP handlers
|
||||
// Root handler
|
||||
http.HandleFunc("GET /{$}",
|
||||
handlers.Root(&conf.Response),
|
||||
)
|
||||
// state->open
|
||||
http.HandleFunc("PUT /state/open",
|
||||
handlers.StateOpen(conf.Credentials, conf.Dynamic.State.Open.AllowedCredentials, &conf.Response.State),
|
||||
)
|
||||
// state->message
|
||||
http.HandleFunc("PUT /state/message",
|
||||
handlers.StateMessagePUT(conf.Credentials, conf.Dynamic.State.Open.AllowedCredentials, &conf.Response.State),
|
||||
)
|
||||
http.HandleFunc("DELETE /state/message",
|
||||
handlers.StateMessageDELETE(conf.Credentials, conf.Dynamic.State.Open.AllowedCredentials, &conf.Response.State),
|
||||
)
|
||||
// Register handler for environmental sensors
|
||||
// Register handlers for environmental sensors
|
||||
for sensorType, envSensorConfigs := range conf.Dynamic.Sensors {
|
||||
for i, envSensorConfig := range envSensorConfigs {
|
||||
urlPattern := "PUT " + util.GetSensorURLPath(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue