From 576c5d749c6c7b71bf00e052c70b26498920947a Mon Sep 17 00:00:00 2001 From: Nulo Date: Mon, 23 Jan 2023 10:46:36 -0300 Subject: [PATCH] elegir puerto --- gitea-ci/main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gitea-ci/main.go b/gitea-ci/main.go index 1635670..7868ddf 100644 --- a/gitea-ci/main.go +++ b/gitea-ci/main.go @@ -24,10 +24,15 @@ func main() { } log.Printf("Logged in as @%s", u.Login) + port := ":8080" + if len(os.Args) > 1 { + port = os.Args[1] + } + http.Handle("/webhook", webhook{config: config, gitea: g}) http.Handle("/logs/socket/", logWebsocket{}) http.Handle("/", http.FileServer(http.Dir("."))) - log.Fatal(http.ListenAndServe(":8080", nil)) + log.Fatal(http.ListenAndServe(port, nil)) } type config struct {