3337bcfc14
Signed-off-by: TIANHE <TIANHE@GMAIL.COM>
34 lines
758 B
Python
34 lines
758 B
Python
"""
|
|
健康检查路由
|
|
"""
|
|
from flask import Blueprint, jsonify
|
|
from datetime import datetime
|
|
|
|
health_bp = Blueprint('health', __name__)
|
|
|
|
|
|
@health_bp.route('/', methods=['GET'])
|
|
def index():
|
|
"""API 首页"""
|
|
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():
|
|
"""健康检查"""
|
|
return jsonify({
|
|
'status': 'healthy',
|
|
'timestamp': datetime.now().isoformat()
|
|
})
|
|
|
|
|
|
@health_bp.route('/api/health', methods=['GET'])
|
|
def api_health_check():
|
|
"""兼容路径:用于容器健康检查/反代探针等场景。"""
|
|
return health_check()
|