28 lines
1.1 KiB
Python
28 lines
1.1 KiB
Python
"""
|
|
Blueprint: health-check (GET /health).
|
|
|
|
Используется платформой Штурвал для проверки живости приложения.
|
|
"""
|
|
|
|
from flask import Blueprint, jsonify, current_app
|
|
|
|
# ═══════════════════════════════════════════════════════════════════════════
|
|
# Blueprint: health check
|
|
# ═══════════════════════════════════════════════════════════════════════════
|
|
|
|
health_bp = Blueprint("health", __name__)
|
|
|
|
|
|
@health_bp.route("/health")
|
|
def health():
|
|
"""Эндпоинт проверки живости.
|
|
|
|
Возвращает JSON с версией приложения.
|
|
Используется платформой для readiness/liveness probes.
|
|
|
|
Returns:
|
|
{"ok": true, "version": "X.Y.Z"}
|
|
"""
|
|
version = current_app.config.get("VERSION", "0.0.0")
|
|
return jsonify({"ok": True, "version": version})
|