File tree Expand file tree Collapse file tree 4 files changed +30
-2
lines changed
Expand file tree Collapse file tree 4 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -293,6 +293,28 @@ curl 'https://glosa.example:4000/api/v1/captcha/?url=https://glosa.example/best-
293293 "token": ""
294294}
295295` ` `
296+
297+ # ## Check if he is alive
298+
299+ GET : Simple answer to check that the service is working.
300+
301+ ` ` ` sh
302+ /api/v1/ping/
303+ ` ` `
304+
305+ # ### Example
306+
307+ ` ` ` sh
308+ curl 'https://glosa.example:4000/api/v1/ping/'
309+ ` ` `
310+
311+ # ### Success response
312+
313+ ` ` ` json
314+ {
315+ "ping": "pong"
316+ }
317+ ` ` `
296318---
297319
298320# # Manager script
Original file line number Diff line number Diff line change 1- (defproject glosa " 1.0.5 "
1+ (defproject glosa " 1.0.6 "
22 :description " glosa"
33 :url " https://github.com/tanrax/glosa"
44 :license {:name " EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
Original file line number Diff line number Diff line change 1111 (context api-prefix []
1212 (GET " /comments/" [] view-public/get-comments)
1313 (POST " /comments/" [] view-public/add-comment)
14- (GET " /captcha/" [] view-public/get-captcha)))
14+ (GET " /captcha/" [] view-public/get-captcha)
15+ (GET " /ping/" [] view-public/pong)))
1516
1617(defroutes resources-routes
1718 ; ; Resources (statics)
Original file line number Diff line number Diff line change 2727 [req]
2828 (render-JSON req (assoc {} :token (captcha/get-token (-> req :params :url )))))
2929
30+ (defn pong
31+ " Gives a simple message to record his abilities to play ping pong while he is alive"
32+ [req]
33+ (render-JSON req {:ping " pong" }))
34+
3035(defn status-404
3136 " Page 404"
3237 [req]
You can’t perform that action at this time.
0 commit comments