summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--system/external/server.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/system/external/server.go b/system/external/server.go
index e765014..08f4137 100644
--- a/system/external/server.go
+++ b/system/external/server.go
@@ -1,9 +1,11 @@
package external
import (
+ "fmt"
"net/http"
"github.com/bosssauce/ponzu/content"
+ "github.com/bosssauce/ponzu/system/api"
"github.com/bosssauce/ponzu/system/db"
)
@@ -13,7 +15,7 @@ type Externalable interface {
}
func init() {
- http.HandleFunc("/api/external/posts", externalPostsHandler)
+ http.HandleFunc("/api/external/posts", api.CORS(externalPostsHandler))
}
func externalPostsHandler(res http.ResponseWriter, req *http.Request) {
@@ -30,6 +32,7 @@ func externalPostsHandler(res http.ResponseWriter, req *http.Request) {
p, found := content.Types[t]
if !found {
+ fmt.Println(t, content.Types, p)
res.WriteHeader(http.StatusNotFound)
return
}