2014-05-17 26 views
0

我遵循以下指示:http://apiaxle.com/docs/statistics-and-analytics-in-apiaxle/。遺憾的是目前(2014年5月17日)apiAxle被重定向我到endPoint服務器和我沒有得到中央集權ApiAxle:無法訪問統計信息網址以查看分析結果

menelaos:~$ curl 'http://localhost:3000/v/api/test/stats? 
granularity=hour&format_timestamp=ISO' 

響應:

{"meta":{"version":1,"status_code":404},"results":{"error": 
{"type":"ApiUnknown","message":"No api specified (via subdomain)"}}} 

我使用子域名也嘗試過,但沒有奏效或者:

menelaos:~$ curl 'http://test.api.localhost:3000/v/api/test/stats?granularity=hour&format_timestamp=ISO' 

回答

3

通常運行的多個實例apiaxle代理(提供您的終端接入)和apiaxle-API的一個實例(它提供了訪問ŧ o統計數據,密鑰創建和其他API管理功能)。

例如,您可能正在運行的代理這樣的:

apiaxle-proxy -f 1 -p 3000 -q

要運行的API,你可以運行這樣的事情:

apiaxle-api -f 1 -p 5000 -q

注意,API需要在一個單獨的端口上運行。還要注意,它不應該被外部世界訪問,因爲它沒有任何認證。使用

上面的例子中,你的curl命令是這樣的:

curl -H 'content-type: application/json' \ 
-X GET \ 
'http://localhost:5000/v1/api/test/stats' \ 
-d '{"granularity":"hour","format_timestamp":"ISO"}' 

注意,參數需要被作爲JSON。

相關問題