This commit is contained in:
parent
4608125fdf
commit
fd341bd9df
7
main.py
7
main.py
@ -114,7 +114,12 @@ class Back():
|
|||||||
|
|
||||||
def deletePost(self, name):
|
def deletePost(self, name):
|
||||||
# TODO: return RESTful error/success result
|
# TODO: return RESTful error/success result
|
||||||
return bool(posts.delete_one({'name': name}).deleted_count)
|
delete = posts.delete_one({'name': name}).deleted_count
|
||||||
|
if not delete:
|
||||||
|
result = dict(status=500, count=delete)
|
||||||
|
else:
|
||||||
|
result = dict(status=200, count=delete)
|
||||||
|
return str(result)
|
||||||
|
|
||||||
|
|
||||||
class Metrics:
|
class Metrics:
|
||||||
|
3
test.sh
3
test.sh
@ -1,5 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
curl_cmd='curl -s -w "%{http_code}" -o /dev/null'
|
curl_cmd='curl -w :%{http_code}'
|
||||||
|
#curl_cmd='curl -s -w "%{http_code}\t%{stdout}" -o /dev/null'
|
||||||
url='server:8080'
|
url='server:8080'
|
||||||
$curl_cmd -X POST $url/admin/post/test -F 'body=testpage' && echo ": Create success" || echo ': create fail'
|
$curl_cmd -X POST $url/admin/post/test -F 'body=testpage' && echo ": Create success" || echo ': create fail'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user