manuels-scolaires/healthcheck.py

16 lines
230 B
Python
Raw Normal View History

2018-06-19 23:52:48 +02:00
import os
import sys
import requests
def main():
port = os.getenv('PORT', 8000)
2018-06-20 00:08:37 +02:00
res = requests.get(f'http://127.0.0.1:{port}/')
2018-06-19 23:52:48 +02:00
if res.status_code >= 400:
sys.exit(1)
if __name__ == '__main__':
main()