Check return code of ListenAndServe()
This commit is contained in:
parent
e5925db736
commit
dedff6a027
8
main.go
8
main.go
|
@ -163,7 +163,7 @@ func main() {
|
|||
RegisterWeb(router)
|
||||
api.Register(router.WithPrefix("/api"))
|
||||
|
||||
go http.ListenAndServe(*listenAddress, router)
|
||||
go listen(router)
|
||||
|
||||
var (
|
||||
hup = make(chan os.Signal)
|
||||
|
@ -227,3 +227,9 @@ func extURL(s string) (*url.URL, error) {
|
|||
|
||||
return u, nil
|
||||
}
|
||||
|
||||
func listen(router *route.Router) {
|
||||
if err := http.ListenAndServe(*listenAddress, router); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue