summaryrefslogtreecommitdiff
path: root/system/api/server.go
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2016-10-06 03:14:10 -0700
committerSteve Manuel <nilslice@gmail.com>2016-10-06 03:14:10 -0700
commitc0ba07669d8403f428ec250e3f3da74844c6c587 (patch)
tree94313747d9abea02b2f3b01c06308225d9db5e4a /system/api/server.go
parent698173a6176762f966be0abd1dc77b85e482a03a (diff)
adding authentication & token-based persistence for users, init setup for first-use, pulling out some handlers into separate file for readability and navigation
Diffstat (limited to 'system/api/server.go')
-rw-r--r--system/api/server.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/system/api/server.go b/system/api/server.go
index 5de10a2..1fb9f02 100644
--- a/system/api/server.go
+++ b/system/api/server.go
@@ -40,7 +40,7 @@ func Run() {
return
}
- posts := db.GetAll(t)
+ posts := db.ContentAll(t)
var all = []json.RawMessage{}
for _, post := range posts {
all = append(all, post)
@@ -66,7 +66,7 @@ func Run() {
return
}
- post, err := db.Get(t + ":" + id)
+ post, err := db.Content(t + ":" + id)
if err != nil {
res.WriteHeader(http.StatusInternalServerError)
return
@@ -123,9 +123,9 @@ func toJSON(data []string) ([]byte, error) {
func wrapJSON(json []byte) []byte {
var buf = &bytes.Buffer{}
- buf.Write([]byte("{data:"))
+ buf.Write([]byte(`{"data":`))
buf.Write(json)
- buf.Write([]byte("}"))
+ buf.Write([]byte(`}`))
return buf.Bytes()
}