summaryrefslogtreecommitdiff
path: root/system/api/handlers.go
diff options
context:
space:
mode:
authorSteve <nilslice@gmail.com>2016-12-19 11:19:53 -0800
committerGitHub <noreply@github.com>2016-12-19 11:19:53 -0800
commit3791fadda7b761ffba38c567da29e2e71acd1dfb (patch)
tree79d810f9aafa1868ee0760983937470d0eea3db8 /system/api/handlers.go
parentb20c5bdee38682edc851e646d815a34689c3c923 (diff)
[addons] Creating foundation for plugin-like system "Addons" (#24)
* adding addons dir and sample addon which enables the use of a new input element in forms for referencing other content. "addons" is a conceptual plugin-like feature, similar to wordpress "plugins" dir, but not as sophisticated
Diffstat (limited to 'system/api/handlers.go')
-rw-r--r--system/api/handlers.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/system/api/handlers.go b/system/api/handlers.go
index 7a2073d..1e2f1e2 100644
--- a/system/api/handlers.go
+++ b/system/api/handlers.go
@@ -8,14 +8,14 @@ import (
"strconv"
"strings"
- "github.com/bosssauce/ponzu/content"
"github.com/bosssauce/ponzu/system/api/analytics"
"github.com/bosssauce/ponzu/system/db"
+ "github.com/bosssauce/ponzu/system/item"
)
func typesHandler(res http.ResponseWriter, req *http.Request) {
var types = []string{}
- for t := range content.Types {
+ for t := range item.Types {
types = append(types, string(t))
}
@@ -36,7 +36,7 @@ func contentsHandler(res http.ResponseWriter, req *http.Request) {
return
}
- if _, ok := content.Types[t]; !ok {
+ if _, ok := item.Types[t]; !ok {
res.WriteHeader(http.StatusNotFound)
return
}
@@ -98,7 +98,7 @@ func contentHandler(res http.ResponseWriter, req *http.Request) {
return
}
- if _, ok := content.Types[t]; !ok {
+ if _, ok := item.Types[t]; !ok {
res.WriteHeader(http.StatusNotFound)
return
}
@@ -224,7 +224,7 @@ func SendJSON(res http.ResponseWriter, j map[string]interface{}) {
sendData(res, data, 200)
}
-// CORS wraps a HandleFunc to response to OPTIONS requests properly
+// CORS wraps a HandleFunc to respond to OPTIONS requests properly
func CORS(next http.HandlerFunc) http.HandlerFunc {
return db.CacheControl(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
if req.Method == http.MethodOptions {