2025-12-29 03:06:49 +08:00
|
|
|
"""
|
2026-04-06 16:47:36 +07:00
|
|
|
Health check routing
|
2025-12-29 03:06:49 +08:00
|
|
|
"""
|
|
|
|
|
from flask import Blueprint, jsonify
|
|
|
|
|
from datetime import datetime
|
|
|
|
|
|
|
|
|
|
health_bp = Blueprint('health', __name__)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@health_bp.route('/', methods=['GET'])
|
|
|
|
|
def index():
|
2026-04-06 16:47:36 +07:00
|
|
|
"""API Home Page"""
|
2025-12-29 03:06:49 +08:00
|
|
|
return jsonify({
|
|
|
|
|
'name': 'QuantDinger Python API',
|
|
|
|
|
'version': '2.0.0',
|
|
|
|
|
'status': 'running',
|
|
|
|
|
'timestamp': datetime.now().isoformat()
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@health_bp.route('/health', methods=['GET'])
|
|
|
|
|
def health_check():
|
2026-04-06 16:47:36 +07:00
|
|
|
"""health check"""
|
2025-12-29 03:06:49 +08:00
|
|
|
return jsonify({
|
|
|
|
|
'status': 'healthy',
|
|
|
|
|
'timestamp': datetime.now().isoformat()
|
|
|
|
|
})
|
|
|
|
|
|
2025-12-29 19:05:17 +08:00
|
|
|
|
|
|
|
|
@health_bp.route('/api/health', methods=['GET'])
|
|
|
|
|
def api_health_check():
|
2026-04-06 16:47:36 +07:00
|
|
|
"""Compatible path: used for container health check/anti-generation probe and other scenarios."""
|
2025-12-29 19:05:17 +08:00
|
|
|
return health_check()
|