How do I know if Crafter-profile or Crafter-Social are working?

I am trying to find a decent URL that will return something else than 404, both in the Crack profile and in Crafter-social, so I know for sure that they are present in tomcat.

Any api / other urls I could use for this?

Thanks,

Nicholas

+5
source share
1 answer

For social:

  • Message 404 is custom ( https://github.com/cortiz/social/blob/2.5.x/server/src/main/webapp/404.jsp ), you can check the HTML response to see if there is a container by default (or apache) or one delivered by applications.

  • Make a call to get the stream (it may not exist) using curl or a browser: /crafter-social/api/3/threads/test/comments?context=f5b143c2-f1c0-4a10-b56e-f485f00d3fe9 you should get an answer like:

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": []}

  1. Terminate the Swagger documentation service: /crafter-social/api-docs

`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-request- with Access-Control-Allow-Credentials: false Content-Type: application / json; charset = UTF-8 Transmission-coding: chunked Date: Tue, 13 Jun 2017 17: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"}}% 

`

For profile:

  • Make a call to get an attribute from an existing user with a nonexistent access token using curl or a browser: /crafter-profile/api/1/profile/12333/attributes?accessTokenId=12345 you should get a response like:

`

 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\""}% 

`

Note: None of these options is optimal, feel free to create a feature request here: https://github.com/craftercms/craftercms/issues to create the proper REST heart rate monitoring service for profile and social.

** Note 2 ** All of the above is valid only for 2.5.x.

+4
source

Source: https://habr.com/ru/post/1268815/


All Articles