From 7d87d40f8d0550331d1b19dea2c374ecfbc77d48 Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Sun, 18 Dec 2016 12:13:08 -0800 Subject: adding beginning of addon api (cooresponding to previous commit w/ reference addon) --- cmd/ponzu/main.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'cmd') diff --git a/cmd/ponzu/main.go b/cmd/ponzu/main.go index ebcbbad..4ae3bcc 100644 --- a/cmd/ponzu/main.go +++ b/cmd/ponzu/main.go @@ -291,7 +291,14 @@ func main() { tls.Enable() } - log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", port), nil)) + // save the port the system is listening on so internal system can make + // HTTP api calls while in dev or production w/o adding more cli flags + err := db.PutConfig("http_port", fmt.Sprintf("%d", port)) + if err != nil { + log.Fatalln("System failed to save config. Please try to run again.") + } + + log.Fatalln(http.ListenAndServe(fmt.Sprintf(":%d", port), nil)) case "": fmt.Println(usage) -- cgit v1.2.3