update
This commit is contained in:
16
main.go
16
main.go
@@ -1,11 +1,11 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"app/datastore"
|
||||
"app/devices"
|
||||
"app/mqtt"
|
||||
"app/telldus"
|
||||
daemon "app/telldus-daemon"
|
||||
"app/pkg/datastore"
|
||||
"app/pkg/devices"
|
||||
"app/pkg/mqtt"
|
||||
"app/pkg/telldus"
|
||||
daemon "app/pkg/telldus-daemon"
|
||||
"encoding/json"
|
||||
"log"
|
||||
"net/http"
|
||||
@@ -25,8 +25,6 @@ var eventMgr *devices.EventManager
|
||||
|
||||
const maxEvents = 1000
|
||||
|
||||
|
||||
|
||||
func main() {
|
||||
// Initialize daemon manager
|
||||
daemonMgr = daemon.New()
|
||||
@@ -140,8 +138,6 @@ func main() {
|
||||
log.Fatal(http.ListenAndServe(httpPort, setupRoutes()))
|
||||
}
|
||||
|
||||
|
||||
|
||||
func getRawEvents(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
json.NewEncoder(w).Encode(eventMgr.GetRawEvents())
|
||||
@@ -355,5 +351,3 @@ func getSensor(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
json.NewEncoder(w).Encode(sensor)
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user