LapisDeploy/main.go
2024-03-07 16:43:06 -06:00

21 lines
410 B
Go

package main
import (
"encoding/json"
"log"
"net/http"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request){
var data map[string]interface{}
err := json.NewDecoder(r.Body).Decode(&data)
if err != nil {
http.Error(w, err.Error(), http.StatusBadRequest)
return
}
log.Default().Printf("Ref: %s", data["ref"])
})
log.Fatal(http.ListenAndServe(":8080", nil))
}