summaryrefslogtreecommitdiff
path: root/system/api/server.go
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2016-10-04 16:31:22 -0700
committerSteve Manuel <nilslice@gmail.com>2016-10-04 16:31:22 -0700
commit29c395635bbc5824f7864f774850d065b506c47d (patch)
treef1a3197bef08b4c14979d13da3264fdecd4489cf /system/api/server.go
parent100a66fd054dbc8c92cb2badd48becf18e13331f (diff)
implementing support for file uploads, fixing some content issues with non-standard characters, removing base64 encoding of content
Diffstat (limited to 'system/api/server.go')
-rw-r--r--system/api/server.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/system/api/server.go b/system/api/server.go
index 5fa0bfc..5de10a2 100644
--- a/system/api/server.go
+++ b/system/api/server.go
@@ -10,7 +10,8 @@ import (
"github.com/nilslice/cms/system/db"
)
-func init() {
+// Run adds Handlers to default http listener for API
+func Run() {
http.HandleFunc("/api/types", func(res http.ResponseWriter, req *http.Request) {
var types = []string{}
for t := range content.Types {
@@ -128,8 +129,3 @@ func wrapJSON(json []byte) []byte {
return buf.Bytes()
}
-
-// Run start the JSON API
-func Run(port string) {
- log.Fatal(http.ListenAndServe(":"+port, nil))
-}