summaryrefslogtreecommitdiff
path: root/cmd/ponzu/main.go
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2016-12-18 12:13:08 -0800
committerSteve Manuel <nilslice@gmail.com>2016-12-18 12:13:08 -0800
commit7d87d40f8d0550331d1b19dea2c374ecfbc77d48 (patch)
treeb0b0e2b346119ec525530f83b4995fe966f2b1dd /cmd/ponzu/main.go
parent5b9f00b427f74d447a3a685a8b7779c86b5a1b9d (diff)
adding beginning of addon api (cooresponding to previous commit w/ reference addon)
Diffstat (limited to 'cmd/ponzu/main.go')
-rw-r--r--cmd/ponzu/main.go9
1 files changed, 8 insertions, 1 deletions
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)