Skip to content

Commit

Permalink
Refactor create service on webserver module
Browse files Browse the repository at this point in the history
  • Loading branch information
0to1a committed Oct 7, 2022
1 parent 21190e0 commit 1f847b9
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions framework/webserver-index.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@ type WebServer struct {
logErrFile *os.File
}

func (w *WebServer) runService(serverPort string, router *echo.Echo) {
log.Print("Webserver: Service Running")
router.HideBanner = true
router.Logger.Panic(router.Start(serverPort))
}

func (w *WebServer) CreateService(port int, router *echo.Echo) {
go func() {
serverPort := ":" + strconv.Itoa(port)

log.Print("Webserver: Service Running")
router.HideBanner = true
router.Logger.Panic(router.Start(serverPort))
w.runService(serverPort, router)
}()

select {}
}

func (w *WebServer) SetupLogFile(logPath string, filenameLog string, filenameError string) {
Expand Down

0 comments on commit 1f847b9

Please sign in to comment.