Init
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Kekskurse 2022-01-16 11:55:37 +01:00
commit aa245d4877
Signed by: kekskurse
GPG key ID: 728ACCB59341E7E4
5 changed files with 50 additions and 0 deletions

17
.drone.yml Normal file
View file

@ -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

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.idea

3
Dockerfile Normal file
View file

@ -0,0 +1,3 @@
FROM scratch
COPY ./notfall /notfall
CMD ["/notfall"]

3
go.mod Normal file
View file

@ -0,0 +1,3 @@
module notfall
go 1.17

26
main.go Normal file
View file

@ -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)
}