elegir puerto
This commit is contained in:
parent
0838dffc81
commit
576c5d749c
1 changed files with 6 additions and 1 deletions
|
@ -24,10 +24,15 @@ func main() {
|
||||||
}
|
}
|
||||||
log.Printf("Logged in as @%s", u.Login)
|
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("/webhook", webhook{config: config, gitea: g})
|
||||||
http.Handle("/logs/socket/", logWebsocket{})
|
http.Handle("/logs/socket/", logWebsocket{})
|
||||||
http.Handle("/", http.FileServer(http.Dir(".")))
|
http.Handle("/", http.FileServer(http.Dir(".")))
|
||||||
log.Fatal(http.ListenAndServe(":8080", nil))
|
log.Fatal(http.ListenAndServe(port, nil))
|
||||||
}
|
}
|
||||||
|
|
||||||
type config struct {
|
type config struct {
|
||||||
|
|
Loading…
Reference in a new issue