This commit is contained in:
commit
aa245d4877
5 changed files with 50 additions and 0 deletions
17
.drone.yml
Normal file
17
.drone.yml
Normal 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
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
.idea
|
3
Dockerfile
Normal file
3
Dockerfile
Normal file
|
@ -0,0 +1,3 @@
|
|||
FROM scratch
|
||||
COPY ./notfall /notfall
|
||||
CMD ["/notfall"]
|
3
go.mod
Normal file
3
go.mod
Normal file
|
@ -0,0 +1,3 @@
|
|||
module notfall
|
||||
|
||||
go 1.17
|
26
main.go
Normal file
26
main.go
Normal 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)
|
||||
}
|
Loading…
Reference in a new issue