Spaces:
Runtime error
Runtime error
wilenPyxi commited on
Commit ·
ad519bc
1
Parent(s): 1a1f494
/health expose APP_VERSION (verifier un deploiement sans se connecter)
Browse files- app/config.py +5 -0
- app/server.py +2 -0
app/config.py
CHANGED
|
@@ -20,6 +20,11 @@ RULES_MD = KNOWLEDGE_DIR / "pythonisation_rules.md"
|
|
| 20 |
FEWSHOTS_DIR = KNOWLEDGE_DIR / "fewshots"
|
| 21 |
TEMPLATES_DIR = PACKAGE_DIR / "web" / "templates"
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
# ── Convention MyST (vérifiée empiriquement : 222/222 exemples plateforme) ───
|
| 24 |
# Bloc {python} = 4 backticks ; enveloppe {exercise} = 5 backticks.
|
| 25 |
PYTHON_FENCE_BACKTICKS = 4
|
|
|
|
| 20 |
FEWSHOTS_DIR = KNOWLEDGE_DIR / "fewshots"
|
| 21 |
TEMPLATES_DIR = PACKAGE_DIR / "web" / "templates"
|
| 22 |
|
| 23 |
+
# ── Version applicative (exposée par /health pour vérifier un déploiement) ───
|
| 24 |
+
# Bumper à chaque déploiement significatif : permet de répondre « à jour ? »
|
| 25 |
+
# sans se connecter (curl /health → champ "version").
|
| 26 |
+
APP_VERSION = "2026-07-06 — MCQ_SPEC v3 + bouton Stop + suivi robuste + Render"
|
| 27 |
+
|
| 28 |
# ── Convention MyST (vérifiée empiriquement : 222/222 exemples plateforme) ───
|
| 29 |
# Bloc {python} = 4 backticks ; enveloppe {exercise} = 5 backticks.
|
| 30 |
PYTHON_FENCE_BACKTICKS = 4
|
app/server.py
CHANGED
|
@@ -242,8 +242,10 @@ def register_routes(app):
|
|
| 242 |
|
| 243 |
@app.route("/health")
|
| 244 |
def health():
|
|
|
|
| 245 |
return jsonify({
|
| 246 |
"status": "ok",
|
|
|
|
| 247 |
"openrouter_api_key": bool(os.getenv("OPENROUTER_API_KEY")),
|
| 248 |
"openai_api_key": bool(os.getenv("OPENAI_API_KEY")),
|
| 249 |
})
|
|
|
|
| 242 |
|
| 243 |
@app.route("/health")
|
| 244 |
def health():
|
| 245 |
+
from app.config import APP_VERSION
|
| 246 |
return jsonify({
|
| 247 |
"status": "ok",
|
| 248 |
+
"version": APP_VERSION,
|
| 249 |
"openrouter_api_key": bool(os.getenv("OPENROUTER_API_KEY")),
|
| 250 |
"openai_api_key": bool(os.getenv("OPENAI_API_KEY")),
|
| 251 |
})
|