"""Utility Handlers.""" from flask import Blueprint, jsonify from core import config from core.hardening.readiness import is_ready base_api = Blueprint('base_api', __name__) @base_api.route(config.Config.HEALTH_CHECK, methods=['GET']) def health(): """Check the health of the application.""" return jsonify({'status': 'ok'}) @base_api.route(config.Config.READY_CHECK) def ready(): """Report whether the DB answers a shallow probe (load-balancer readiness).""" return ({'status': 'ok'}, 200) if is_ready() else ({'status': 'unavailable'}, 503)