This repository has been archived on 2023-11-11. You can view files and clone it, but cannot push or open issues or pull requests.
automated-youtube-dl/server/api/health/health.py

21 lines
466 B
Python

from datetime import datetime
from flask import Blueprint, jsonify
from server import opts
from server.health import run_all_functions
health_route = Blueprint('health', __name__)
@health_route.route('/', methods=['GET'])
def health_check():
uptime = str(datetime.now() - opts.start_time)
exit_code, api_results = run_all_functions()
return jsonify({
'health': exit_code,
'uptime': uptime,
'api_results': api_results
})