21 lines
398 B
Go
21 lines
398 B
Go
|
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))
|
||
|
}
|