This commit is contained in:
parent
89dcffa6bb
commit
96790be6f7
10
main.py
10
main.py
@ -104,6 +104,16 @@ class Back():
|
|||||||
return bool(posts.delete_one({'name': name}).deleted_count)
|
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/<name>')
|
@route('/post/<name>')
|
||||||
def post(name):
|
def post(name):
|
||||||
'''
|
'''
|
||||||
|
2
test.sh
2
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 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 -X DELETE $url/admin/post/test && echo ": delete success" || echo ': delete fail'
|
||||||
|
|
||||||
|
$curl_cmd $url/metrics && echo ": metrics available" || echo ': metrics unavailable'
|
||||||
|
Loading…
Reference in New Issue
Block a user