summaryrefslogtreecommitdiff
path: root/cmd/ponzu/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/ponzu/main.go')
-rw-r--r--cmd/ponzu/main.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/cmd/ponzu/main.go b/cmd/ponzu/main.go
index ebcbbad..b2b5e75 100644
--- a/cmd/ponzu/main.go
+++ b/cmd/ponzu/main.go
@@ -15,6 +15,9 @@ import (
"github.com/bosssauce/ponzu/system/api/analytics"
"github.com/bosssauce/ponzu/system/db"
"github.com/bosssauce/ponzu/system/tls"
+
+ // import registers content types
+ _ "github.com/bosssauce/ponzu/content"
)
var year = fmt.Sprintf("%d", time.Now().Year())
@@ -291,7 +294,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)