Files

35 lines
805 B
Python
Raw Permalink Normal View History

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