.
This commit is contained in:
parent
38e72e2a0c
commit
abe6ba4ed6
3 changed files with 4 additions and 6 deletions
|
|
@ -2,11 +2,11 @@ package main
|
|||
|
||||
import (
|
||||
"io"
|
||||
"fmt"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func alertReceiver(w http.ResponseWriter, r *http.Request) {
|
||||
cfg := LoadConfig()
|
||||
if r.Method != http.MethodPost {
|
||||
http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)
|
||||
return
|
||||
|
|
@ -25,6 +25,7 @@ func alertReceiver(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
payload := ParseAlert(body)
|
||||
fmt.Printf(payload)
|
||||
publish := sendAlerts(cfg, payload)
|
||||
check(publish)
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue