From 28eab815255e437afb7efabf89b84a74fbc6af71 Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Sat, 17 Dec 2016 06:46:16 -0800 Subject: adding a new addon "get" --- system/api/server.go | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) (limited to 'system') diff --git a/system/api/server.go b/system/api/server.go index d663fe4..f31a748 100644 --- a/system/api/server.go +++ b/system/api/server.go @@ -1,11 +1,6 @@ package api -import ( - "bytes" - "fmt" - "log" - "net/http" -) +import "net/http" // Run adds Handlers to default http listener for API func Run() { @@ -17,23 +12,3 @@ func Run() { http.HandleFunc("/api/content/external", CORS(Record(externalContentHandler))) } - -// ContentAll retrives all items from the HTTP API within the provided namespace -func ContentAll(namespace string) []byte { - endpoint := "http://0.0.0.0:8080/api/contents?type=" - buf := []byte{} - r := bytes.NewReader(buf) - req, err := http.NewRequest(http.MethodGet, endpoint+namespace, r) - if err != nil { - log.Println("Error creating request for reference from:", namespace) - return nil - } - - c := http.Client{} - res, err := c.Do(req) - defer res.Body.Close() - - fmt.Println(res, string(buf)) - - return buf -} -- cgit v1.2.3