diff --git a/main.py b/main.py index c09a7c4..4690a59 100755 --- a/main.py +++ b/main.py @@ -104,6 +104,16 @@ class Back(): return bool(posts.delete_one({'name': name}).deleted_count) +class Metrics: + def alive(): + return str("alive 1") + + +@route('/metrics') +def metrics(): + return Metrics.alive() + + @route('/post/') def post(name): ''' diff --git a/test.sh b/test.sh index 9c56f0c..45b7844 100644 --- a/test.sh +++ b/test.sh @@ -8,3 +8,5 @@ $curl_cmd $url/post/test && echo ": get Success" || echo ': get fail' $curl_cmd -X POST $url/admin/post/test -F 'body=testpage2' && echo ": Update success" || echo ': update fail' $curl_cmd -X DELETE $url/admin/post/test && echo ": delete success" || echo ': delete fail' + +$curl_cmd $url/metrics && echo ": metrics available" || echo ': metrics unavailable'