Skip to content

Commit

Permalink
Refactor server start output and add network IP addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
funnyzak committed Feb 20, 2024
1 parent 731ba03 commit 2bb3480
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ needs.setup.outputs.TAG_NAME }}

- name: Download artifacts
uses: actions/download-artifact@v4

Expand Down
12 changes: 6 additions & 6 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,23 +53,23 @@ func main() {
srv := controller.ServerWeb(port)

startOutput := func() {

fmt.Println()
fmt.Println("Server available routes:")
mygin.PrintRoute(srv.Handler.(*gin.Engine))

fmt.Println()
fmt.Println("Server is running with config:")
utils.PrintStructFieldsAndValues(singleton.Conf, "")

fmt.Println()
fmt.Println("Server is running at:")
fmt.Printf(" - %-7s: %s\n", "Local", utils.Colorize(utils.ColorGreen, fmt.Sprintf("http://127.0.0.1:%d", port)))
ipv4s, err := ip.GetIPv4NetworkIPs()
if ipv4s != nil && err == nil {
fmt.Println("Server is running at:")
for _, ip := range ipv4s {
fmt.Printf(" - %-7s: %s\n", "Network", utils.Colorize(utils.ColorGreen, fmt.Sprintf("http://%s:%d", ip, port)))
}
}

fmt.Println()
fmt.Println("Server available routes:")
mygin.PrintRoute(srv.Handler.(*gin.Engine))
fmt.Println()
}

Expand Down

0 comments on commit 2bb3480

Please sign in to comment.