feat(webhook): add webhook client for RSVP and photo uploads
This commit is contained in:
+3
-1
@@ -14,6 +14,7 @@ import (
|
||||
"wedding-server/internal/config"
|
||||
"wedding-server/internal/mail"
|
||||
"wedding-server/internal/store"
|
||||
"wedding-server/internal/webhook"
|
||||
)
|
||||
|
||||
//go:embed all:web/dist
|
||||
@@ -37,9 +38,10 @@ func main() {
|
||||
defer st.Close()
|
||||
|
||||
mailer := mail.New(cfg.Email)
|
||||
wh := webhook.New(cfg.Webhook)
|
||||
|
||||
mux := http.NewServeMux()
|
||||
api.New(cfg, st, mailer).Routes(mux)
|
||||
api.New(cfg, st, mailer, wh).Routes(mux)
|
||||
|
||||
uploadsDir := filepath.Join(cfg.Storage.DataDir, "photos")
|
||||
mux.Handle("/uploads/", http.StripPrefix("/uploads/", http.FileServer(http.Dir(uploadsDir))))
|
||||
|
||||
Reference in New Issue
Block a user