commit aa245d487754b8c62e4825a7bd54d47f113a907c Author: kekskurse Date: Sun Jan 16 11:55:37 2022 +0100 Init diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..6a31df6 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,17 @@ +--- +kind: pipeline +type: docker +name: default + +steps: + - name: build + image: golang + commands: + - go build -o notfall ./ + - name: docker + image: plugins/docker + settings: + repo: kekskurse/notfall + username: kekskurse + password: + from_secret: docker_password \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..723ef36 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f3cf355 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM scratch +COPY ./notfall /notfall +CMD ["/notfall"] \ No newline at end of file diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..24b8db2 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module notfall + +go 1.17 diff --git a/main.go b/main.go new file mode 100644 index 0000000..9091726 --- /dev/null +++ b/main.go @@ -0,0 +1,26 @@ +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) +} \ No newline at end of file