26 lines
459 B
Go
26 lines
459 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"encoding/json"
|
||
|
"fmt"
|
||
|
"net/http"
|
||
|
)
|
||
|
|
||
|
var lastData interface{}
|
||
|
|
||
|
func main() {
|
||
|
http.HandleFunc("/owntrack", func(writer http.ResponseWriter, request *http.Request) {
|
||
|
var p interface{}
|
||
|
err := json.NewDecoder(request.Body).Decode(&p)
|
||
|
if err != nil {
|
||
|
return "Somethuing go wrong"
|
||
|
}
|
||
|
fmt.Println(p)
|
||
|
})
|
||
|
|
||
|
http.HandleFunc("/", func(writer http.ResponseWriter, request *http.Request) {
|
||
|
|
||
|
})
|
||
|
|
||
|
http.ListenAndServe(":8080", nil)
|
||
|
}
|