Skip to content

Commit

Permalink
fatal on port in use
Browse files Browse the repository at this point in the history
  • Loading branch information
F1bonacc1 committed Jul 20, 2023
1 parent 6ff27e0 commit 89faad4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,10 @@ func StartHttpServer(useLogger bool, port int, project app.IProject) {

log.Info().Msgf("start http server listening %s", endPoint)

go server.ListenAndServe()
go func() {
err := server.ListenAndServe()
if err != nil {
log.Fatal().Err(err).Msgf("start http server on %s failed", endPoint)
}
}()
}

0 comments on commit 89faad4

Please sign in to comment.