21 lines
466 B
Python
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
|
|
})
|