我試圖找到一個體面的URL,它會在crafter-profile和crafter-social上返回404以外的東西,這樣我就可以確定它們存在於tomcat中。如何知道crafter-profile或crafter-social是否正在運行?
任何我可以使用的API /其他URL?
謝謝
薩科
我試圖找到一個體面的URL,它會在crafter-profile和crafter-social上返回404以外的東西,這樣我就可以確定它們存在於tomcat中。如何知道crafter-profile或crafter-social是否正在運行?
任何我可以使用的API /其他URL?
謝謝
薩科
對於社會:
404消息是一個自定義(https://github.com/cortiz/social/blob/2.5.x/server/src/main/webapp/404.jsp),你可以檢查響應的HTML,看看是否是容器默認(或apache)或應用程序交付的。
撥打電話,以獲得一個線程(可能是不存在的),使用捲曲或瀏覽器:/crafter-social/api/3/threads/test/comments?context=f5b143c2-f1c0-4a10-b56e-f485f00d3fe9
你應該得到這樣的迴應:
HTTP/1.1 200 Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST, GET, PUT, DELETE
Access-Control-Max-Age: 3600
Access-Control-Allow-Headers: x-requested-with
Access-Control-Allow-Credentials: false
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Tue, 13 Jun 2017 16:45:31 GMT
{"total":0,"pageSize":666,"pageNumber":0,"watched":false,"comments": []}
/crafter-social/api-docs
` HTTP/1.1 200 訪問控制 - 允許 - 起源:* 訪問控制 - 允許 - 方法:POST,GET,PUT,刪除 訪問控制 - 最大年齡:3600 訪問控制 - 允許 - 標題:x請求 - 與 接入控制允許憑證:假 內容類型:應用/ JSON;字符集= UTF-8 傳輸編碼:分塊 日期:星期二,2017年6月13日十七時12分45秒GMT
{"apiVersion":"1.0","swaggerVersion":"1.2","apis":[{"path":"/default/comment-services","description":"Comments services"},{"path":"/default/comment-services-extension","description":"Comments services Extension"},{"path":"/default/handles-context-configuration","description":"Creates and associates Social Context to profiles"},{"path":"/default/security-actions","description":"Services to Admin Security Actions"},{"path":"/default/system-profile","description":"Clears profile cache,Only for Social Admins or Super Admins."},{"path":"/default/threads-controller","description":"Threads Controller"}],"info":{"title":"API Title","description":"API Description","termsOfServiceUrl":"API terms of service","contact":"API Contact Email","license":"API Licence Type","licenseUrl":"API License URL"}}%
`
對於配置文件:
/crafter-profile/api/1/profile/12333/attributes?accessTokenId=12345
你應該得到這樣的迴應:`
HTTP/1.1 403
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Tue, 13 Jun 2017 17:03:39 GMT
{"errorCode":"NO_SUCH_ACCESS_TOKEN_ID","message":"No access token found for ID \"12345\""}%
`
注: 既不的所有給出的選項是最佳的,隨意在這裏創建功能要求:https://github.com/craftercms/craftercms/issues建爲Profile和Social提供適當的REST心跳監視器服務。
**注2 ** 以上所有僅適用於2.5.x.
看起來像/../api-docs/這兩個配置文件和社會是目前最好的選擇。非常感謝。是的,設計用於監控的真正API是理想的。我會在發佈關於它的問題時提出您的要約。 –