我正在按照http://apiaxle.com/docs/statistics-and-analytics-in-apiaxle/上的说明行事。不幸的是,目前(2014年5月17日) apiAxle正在将我重定向到endPoint
服务器,而我没有获得统计信息。
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'
发布于 2014-06-01 03:39:35
通常情况下,您运行多个像素代理实例(它提供对端点的访问),以及一个ap桥API实例(该实例提供了对统计信息、密钥创建和其他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的形式发送。
https://stackoverflow.com/questions/23712621
复制相似问题