Move healthcheck.py to scripts

This commit is contained in:
Piero Toffanin 2023-01-16 12:16:30 -05:00
parent ec87536412
commit 590e543864
2 changed files with 1 additions and 1 deletions

11
scripts/healthcheck.py Normal file
View file

@ -0,0 +1,11 @@
import requests
response = requests.post(
url='http://0.0.0.0:5000/translate',
headers={'Content-Type': 'application/json'},
json={
'q': 'Hello World!',
'source': 'en',
'target': 'en'
}
)
# if server unavailable then requests with raise exception and healthcheck will fail