From a8d9e02831d4b01e47f24a30144b5522c03b2b8c Mon Sep 17 00:00:00 2001 From: Horus_Arch Date: Fri, 20 Feb 2015 20:40:51 +0100 Subject: Config for ip and port. Health check updates now database and redis cache. --- app/main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app/main.go') diff --git a/app/main.go b/app/main.go index 35a162a..72be13c 100644 --- a/app/main.go +++ b/app/main.go @@ -6,6 +6,7 @@ import ( "github.com/robfig/cron" "html/template" "net/http" + "os" ) var decoder = schema.NewDecoder() @@ -17,6 +18,7 @@ var c = cron.New() func main() { run() InitDB() + insertHost() r := mux.NewRouter() r.HandleFunc("/", IndexHandler) @@ -28,5 +30,7 @@ func main() { r.HandleFunc("/new", PrintNewJobHandler).Methods("GET") r.HandleFunc("/jobs", ShowJobHandler) http.Handle("/", r) - http.ListenAndServe(":8080", nil) + ip := os.Getenv("STATUS_HTTP_IP") + port := os.Getenv("STATUS_HTTP_PORT") + http.ListenAndServe(ip+":"+port, nil) } -- cgit v1.2.3