2024-03-07 15:11:25 -06:00
|
|
|
package main
|
|
|
|
|
2024-03-07 16:43:06 -06:00
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
"log"
|
|
|
|
"net/http"
|
|
|
|
)
|
2024-03-07 15:11:25 -06:00
|
|
|
|
|
|
|
func main() {
|
2024-03-07 16:43:06 -06:00
|
|
|
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))
|
2024-03-07 15:11:25 -06:00
|
|
|
}
|