bella mqtt quasi va

This commit is contained in:
2019-10-28 00:20:21 +01:00
parent 93846dbbea
commit 9d253644bd
12 changed files with 355 additions and 30 deletions

View File

@@ -4,6 +4,7 @@ import (
"log"
"net/http"
"github.com/go-macaron/binding"
"github.com/go-macaron/pongo2"
"gopkg.in/macaron.v1"
)
@@ -20,6 +21,10 @@ func startServer() {
m.Post("/json/outlet/:outlet/off", jsonOutletPowerOFF)
m.Post("/json/outlet/:outlet/toggle", jsonOutletPowerToggle)
m.Get("/settings/mqtt", webGETSettingsMQTT)
m.Post("/json/settings/mqtt", binding.Bind(SettingsMQTTForm{}), webPOSTSettingsMQTT)
// m.Post("/settings/mqtt", webPOSTSettingsMQTT)
m.Get("/boards", func(ctx *macaron.Context) {
ctx.HTML(200, "boards") // 200 is the response code.
})