summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/ponzu/main.go15
-rw-r--r--system/admin/server.go3
-rw-r--r--system/api/handlers.go2
-rw-r--r--system/api/server.go7
-rw-r--r--system/db/content.go3
5 files changed, 4 insertions, 26 deletions
diff --git a/cmd/ponzu/main.go b/cmd/ponzu/main.go
index e9c4354..e90d318 100644
--- a/cmd/ponzu/main.go
+++ b/cmd/ponzu/main.go
@@ -117,7 +117,6 @@ func main() {
}
case "run":
- fmt.Println("Running..")
var addTLS string
if https {
addTLS = "--https"
@@ -136,8 +135,6 @@ func main() {
services = "admin,api"
}
- fmt.Println("services:", services)
-
serve := exec.Command("./ponzu-server",
fmt.Sprintf("--port=%d", port),
fmt.Sprintf("--httpsport=%d", httpsport),
@@ -160,29 +157,22 @@ func main() {
os.Exit(1)
}
- fmt.Println("serve command executed.")
-
case "serve", "s":
db.Init()
defer db.Close()
- fmt.Println("called db.Init()")
analytics.Init()
defer analytics.Close()
- fmt.Println("called analytics.Init()")
if len(args) > 1 {
services := strings.Split(args[1], ",")
- fmt.Println("configured to start services:", services)
for i := range services {
if services[i] == "api" {
api.Run()
- fmt.Println("called api.Run()")
} else if services[i] == "admin" {
admin.Run()
- fmt.Println("called admin.Run()")
} else {
fmt.Println("To execute 'ponzu serve', you must specify which service to run.")
@@ -197,7 +187,6 @@ func main() {
if err != nil {
log.Fatalln("System failed to save config. Please try to run again.", err)
}
- fmt.Println("called db.PutConfig('https_port')")
// cannot run production HTTPS and development HTTPS together
if devhttps {
@@ -222,10 +211,10 @@ func main() {
if err != nil {
log.Fatalln("System failed to save config. Please try to run again.", err)
}
- fmt.Println("called db.PutConfig('http_port')")
+ fmt.Printf("Server listening on :%d for HTTP requests...\n", port)
+ fmt.Println("\nvisit `/admin` to get started.")
log.Fatalln(http.ListenAndServe(fmt.Sprintf(":%d", port), nil))
- fmt.Println("called http.ListenAndServe()")
case "":
fmt.Println(usage)
diff --git a/system/admin/server.go b/system/admin/server.go
index 25ff52c..11bfe6f 100644
--- a/system/admin/server.go
+++ b/system/admin/server.go
@@ -1,7 +1,6 @@
package admin
import (
- "fmt"
"log"
"net/http"
"os"
@@ -53,6 +52,4 @@ func Run() {
// through the editor will not load within the admin system.
uploadsDir := filepath.Join(pwd, "uploads")
http.Handle("/api/uploads/", api.Record(api.CORS(db.CacheControl(http.StripPrefix("/api/uploads/", http.FileServer(restrict(http.Dir(uploadsDir))))))))
-
- fmt.Println("Admin routes registered.")
}
diff --git a/system/api/handlers.go b/system/api/handlers.go
index 071a373..2473c24 100644
--- a/system/api/handlers.go
+++ b/system/api/handlers.go
@@ -231,7 +231,7 @@ func toJSON(data []string) ([]byte, error) {
return buf.Bytes(), nil
}
-// sendData() should be used any time you want to communicate
+// sendData should be used any time you want to communicate
// data back to a foreign client
func sendData(res http.ResponseWriter, data []byte, code int) {
res, cors := responseWithCORS(res)
diff --git a/system/api/server.go b/system/api/server.go
index e2af125..4b8b22e 100644
--- a/system/api/server.go
+++ b/system/api/server.go
@@ -1,9 +1,6 @@
package api
-import (
- "fmt"
- "net/http"
-)
+import "net/http"
// Run adds Handlers to default http listener for API
func Run() {
@@ -14,6 +11,4 @@ func Run() {
http.HandleFunc("/api/content", Record(CORS(contentHandler)))
http.HandleFunc("/api/content/external", Record(CORS(externalContentHandler)))
-
- fmt.Println("API routes registered.")
}
diff --git a/system/db/content.go b/system/db/content.go
index b8d9cb8..010e5cb 100644
--- a/system/db/content.go
+++ b/system/db/content.go
@@ -450,13 +450,11 @@ func SortContent(namespace string) {
bname := []byte(namespace + "__sorted")
err := tx.DeleteBucket(bname)
if err != nil && err != bolt.ErrBucketNotFound {
- fmt.Println("Error in DeleteBucket")
return err
}
b, err := tx.CreateBucketIfNotExists(bname)
if err != nil {
- fmt.Println("Error in CreateBucketIfNotExists")
return err
}
@@ -465,7 +463,6 @@ func SortContent(namespace string) {
cid := fmt.Sprintf("%d:%d", i, posts[i].Time())
err = b.Put([]byte(cid), bb[i])
if err != nil {
- fmt.Println("Error in Put")
return err
}
}