Skip to content

Commit

Permalink
fix(listening port): listening can be disabled with --port=0
Browse files Browse the repository at this point in the history
Signed-off-by: Szilard Parrag <szilard.parrag@axoflow.com>
  • Loading branch information
OverOrion committed Aug 30, 2023
1 parent b6483a5 commit fa5df35
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ func main() {
}

events.Add(events.OnStart())
info.Printf("listening on port:%v\n", *port)
info.Println(http.ListenAndServe(fmt.Sprintf(":%v", *port), httpApi))
if *port != 0 {
info.Printf("listening on port:%v\n", *port)
info.Println(http.ListenAndServe(fmt.Sprintf(":%v", *port), httpApi))
} else {
info.Printf("listening port disabled\n")
}
}

0 comments on commit fa5df35

Please sign in to comment.