This program takes a GitHub webhook POST request, parses it according to configuration, and redirects it to another POST endpoint.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

main.go 657B

123456789101112131415161718192021222324252627282930
  1. package main
  2. import (
  3. "fmt"
  4. "net/http"
  5. "time"
  6. "github.com/stormfirefox1/GitHookParser/server"
  7. "github.com/sirupsen/logrus"
  8. "github.com/stormfirefox1/GitHookParser/config"
  9. "github.com/stormfirefox1/GitHookParser/log"
  10. )
  11. func main() {
  12. log.Info(logrus.Fields{
  13. "bootTime": time.Now(),
  14. }, "Booting up...")
  15. server := server.Server{
  16. Env: config.New("$HOME/.config/git-hook-parser/config.yml"),
  17. }
  18. fmt.Printf("GitHookParser v.%s \n", server.Env.Get("APP_VERSION"))
  19. fmt.Printf("Listening on port " + fmt.Sprint(server.Env.Get("HANDLER_PORT")))
  20. server.Routes()
  21. http.ListenAndServe(fmt.Sprint(server.Env.Get("HANDLER_PORT")), server.Router)
  22. }