ntfy-alertmanager/main.go

21 lines
398 B
Go
Raw Normal View History

2022-10-09 14:19:48 +02:00
package main
import (
"net/http"
"strings"
"git.xenrox.net/~xenrox/go-log"
)
func handleWebhooks(w http.ResponseWriter, r *http.Request) {
http.Post("https://ntfy.sh/alertmanager_test", "text/plain",
strings.NewReader("Payload received"))
}
func main() {
logger := log.NewDefaultLogger()
http.HandleFunc("/", handleWebhooks)
logger.Fatal(http.ListenAndServe("127.0.0.1:8080", nil))
}