mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-11-23 20:35:24 +01:00
fix(be): check port format
This commit is contained in:
parent
bc3210994a
commit
67099f1031
@ -15,6 +15,7 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var configPath string
|
||||
@ -48,6 +49,12 @@ func runService() {
|
||||
|
||||
util.Config.PrintDbInfo()
|
||||
|
||||
port := util.Config.Port
|
||||
|
||||
if !strings.HasPrefix(port, ":") {
|
||||
port = ":" + port
|
||||
}
|
||||
|
||||
fmt.Printf("Tmp Path (projects home) %v\n", util.Config.TmpPath)
|
||||
fmt.Printf("Semaphore %v\n", util.Version)
|
||||
fmt.Printf("Interface %v\n", util.Config.Interface)
|
||||
@ -81,7 +88,7 @@ func runService() {
|
||||
store.Close("root")
|
||||
}
|
||||
|
||||
err := http.ListenAndServe(util.Config.Interface+util.Config.Port, cropTrailingSlashMiddleware(router))
|
||||
err := http.ListenAndServe(util.Config.Interface+port, cropTrailingSlashMiddleware(router))
|
||||
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
|
Loading…
Reference in New Issue
Block a user