From abe6ba4ed6e865cab9fe15ba16461f6a3c214e34 Mon Sep 17 00:00:00 2001 From: Iru Sensei Date: Sun, 23 Nov 2025 19:30:28 +0100 Subject: [PATCH] . --- main.go | 3 --- nostr.go | 2 +- server.go | 5 +++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index d8a4cd6..67809f1 100644 --- a/main.go +++ b/main.go @@ -8,9 +8,6 @@ import ( func main() { cfg := LoadConfig() - for _, relay := range cfg.Relays { - log.Printf(relay) - } http.HandleFunc("/", alertReceiver) log.Printf("Server starting on http://localhost:%d", cfg.Port) log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", cfg.Port), nil)) diff --git a/nostr.go b/nostr.go index 88e5e02..ae89f6b 100644 --- a/nostr.go +++ b/nostr.go @@ -7,7 +7,7 @@ import ( "time" ) -func sendAlerts(config Config, alert string) error { +func sendAlerts(config *Config, alert string) error { pool := nostr.NewPool(nostr.PoolOptions{ PenaltyBox: true, diff --git a/server.go b/server.go index 4d7c516..64cab5d 100644 --- a/server.go +++ b/server.go @@ -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) }