feat: update logs

This commit is contained in:
Urko. 2024-05-25 06:47:21 +02:00
parent eaf0b1ff69
commit f6e4e64e81
1 changed files with 3 additions and 1 deletions

View File

@ -27,8 +27,8 @@ func main() {
if err != nil {
log.Fatalf("Error loading config: %v", err)
}
log.Println("GOOO")
http.HandleFunc("/", handlePayload(cfg.Secret, cfg.Projects))
log.Printf("server is up on %d\n", cfg.Port)
http.ListenAndServe(fmt.Sprintf(":%d", cfg.Port), nil)
}
@ -57,6 +57,7 @@ func handlePayload(secret string, projects map[string][]config.ConfigScript) fun
proj, found := projects[project]
if !found {
http.Error(w, "not found", http.StatusNotFound)
log.Printf("project %s not found\n", project)
return
}
var payload internal.WebhookPayload
@ -77,6 +78,7 @@ func handlePayload(secret string, projects map[string][]config.ConfigScript) fun
}
if !found {
http.Error(w, "not found", http.StatusNotFound)
log.Printf("project %s with branch %s not found\n", project, branchName)
return
}