diff options
author | Steve Manuel <nilslice@gmail.com> | 2017-07-23 12:03:10 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-23 12:03:10 -0600 |
commit | a931ae0a72802d28807a156dba399aaef4531e49 (patch) | |
tree | a9a28463605eb06eb311eb184397dfc575c759ea /system/addon/api.go | |
parent | 271bae22b9c954d76e96712a44fe4702f356d116 (diff) | |
parent | b1b0c8b76017ffe7dc60d11d79ec81a8e3d03bce (diff) |
Merge pull request #178 from ponzu-cms/ponzu-dev
[cli] add --bind option to run cmd on CLI to set address of listener
Diffstat (limited to 'system/addon/api.go')
-rw-r--r-- | system/addon/api.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/system/addon/api.go b/system/addon/api.go index cd792aa..ae4909b 100644 --- a/system/addon/api.go +++ b/system/addon/api.go @@ -18,10 +18,10 @@ type QueryOptions db.QueryOptions // ContentAll retrives all items from the HTTP API within the provided namespace func ContentAll(namespace string) []byte { - host := db.ConfigCache("domain").(string) + addr := db.ConfigCache("bind_addr").(string) port := db.ConfigCache("http_port").(string) endpoint := "http://%s:%s/api/contents?type=%s&count=-1" - URL := fmt.Sprintf(endpoint, host, port, namespace) + URL := fmt.Sprintf(endpoint, addr, port, namespace) j, err := Get(URL) if err != nil { @@ -35,10 +35,10 @@ func ContentAll(namespace string) []byte { // Query retrieves a set of content from the HTTP API based on options // and returns the total number of content in the namespace and the content func Query(namespace string, opts QueryOptions) []byte { - host := db.ConfigCache("domain").(string) + addr := db.ConfigCache("bind_addr").(string) port := db.ConfigCache("http_port").(string) endpoint := "http://%s:%s/api/contents?type=%s&count=%d&offset=%d&order=%s" - URL := fmt.Sprintf(endpoint, host, port, namespace, opts.Count, opts.Offset, opts.Order) + URL := fmt.Sprintf(endpoint, addr, port, namespace, opts.Count, opts.Offset, opts.Order) j, err := Get(URL) if err != nil { |