From 0ce40fd46e025cdbe3b84c1189a198fe00b2f1df Mon Sep 17 00:00:00 2001 From: Eugene Bujak Date: Thu, 6 Sep 2018 02:00:57 +0300 Subject: [PATCH] Start coredns on launch before we serve HTTP -- this checks if port is available --- app.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app.go b/app.go index 3ca54175..57e9ea56 100644 --- a/app.go +++ b/app.go @@ -122,6 +122,11 @@ func main() { http.Handle("/", http.FileServer(box)) registerControlHandlers() + err = startDNSServer() + if err != nil { + log.Fatal(err) + } + URL := fmt.Sprintf("http://%s", address) log.Println("Go to " + URL) log.Fatal(http.ListenAndServe(address, nil))