Added Dockerfile

This commit is contained in:
Robin Dittmar
2026-07-03 10:30:33 +02:00
parent 4afb76cea0
commit d98e8e9244
3 changed files with 24 additions and 16 deletions
+4 -16
View File
@@ -45,13 +45,7 @@ func main() {
log.Print(err)
}
b, err := json.Marshal(resp)
if err != nil {
log.Println(err)
return
}
_, err = w.Write(b)
err := json.NewEncoder(w).Encode(resp)
if err != nil {
log.Println(err)
return
@@ -61,19 +55,13 @@ func main() {
http.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) {
resp := HealthResponse{Status: "ok"}
b, err := json.Marshal(&resp)
if err != nil {
log.Println(err)
return
}
_, err = w.Write(b)
err := json.NewEncoder(w).Encode(resp)
if err != nil {
log.Println(err)
return
}
})
fmt.Println("Listening on localhost:8080")
log.Fatal(http.ListenAndServe("localhost:8080", nil))
fmt.Println("Listening on port 8080")
log.Fatal(http.ListenAndServe(":8080", nil))
}