code: log error if http server does not go online

master
ALI Hamza 2019-09-26 07:42:13 +07:00
parent ff104cd6af
commit 24918bf1e2
No known key found for this signature in database
GPG Key ID: BCA8A46C87798C4C
1 changed files with 4 additions and 1 deletions

@ -39,5 +39,8 @@ func main() {
http.HandleFunc("/websocket", websocketConnection)
http.Handle("/", http.FileServer(http.Dir("./static")))
http.ListenAndServe(":8080", nil)
err := http.ListenAndServe(":8080", nil)
if err != nil {
fmt.Errorf("Server could not start up: %s", err.Error())
}
}