diff options
| author | Horus_Arch | 2015-02-20 20:40:51 +0100 |
|---|---|---|
| committer | Horus_Arch | 2015-02-20 20:40:51 +0100 |
| commit | a8d9e02831d4b01e47f24a30144b5522c03b2b8c (patch) | |
| tree | f396994bbe050d14db73048572481d63f175d750 /app/main.go | |
| parent | ffe1b892b4c01c40215a1b8b5697fc35b81186b5 (diff) | |
| download | statuspage-a8d9e02831d4b01e47f24a30144b5522c03b2b8c.tar.gz | |
Config for ip and port. Health check updates now database and redis cache.
Diffstat (limited to 'app/main.go')
| -rw-r--r-- | app/main.go | 6 |
1 files changed, 5 insertions, 1 deletions
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) } |
