display ip

This commit is contained in:
Fran Jurmanović
2021-05-25 20:55:37 +02:00
parent ddc367e316
commit 4076a7b010
2 changed files with 27 additions and 1 deletions

View File

@@ -1,8 +1,11 @@
package server
import (
"fmt"
"os"
"wallet-api/pkg/utl/common"
"github.com/gin-gonic/gin"
)
@@ -16,6 +19,10 @@ func Start(r *gin.Engine) *gin.Engine {
if port == "" {
port = "4000"
}
r.Run(":" + port)
err := r.Run(":" + port)
if err != nil {
msg := fmt.Sprintf("Running on %s:%s", common.GetIP(), port)
println(msg)
}
return r
}