Фаза 2: site/app.py → blueprint'ы (main, health, api), старый drhider.py удалён
Deploy drhider / validate (push) Waiting to run
Deploy drhider / validate (push) Waiting to run
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
"""
|
||||
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})
|
||||
Reference in New Issue
Block a user