Merge Sprint 7-8 CI/CD + Docker + Monitoring (HRT-33)
This commit is contained in:
@@ -131,6 +131,24 @@ def get_db():
|
||||
return conn
|
||||
|
||||
|
||||
@app.route("/health")
|
||||
@app.route("/turf/health")
|
||||
def health():
|
||||
"""Health check endpoint for Docker/load balancer. Returns 200 if app is running."""
|
||||
import sqlite3 as _sqlite3
|
||||
|
||||
db_ok = True
|
||||
try:
|
||||
conn = _sqlite3.connect(DB_PATH, timeout=2)
|
||||
conn.execute("SELECT 1")
|
||||
conn.close()
|
||||
except Exception:
|
||||
db_ok = False
|
||||
status = "ok" if db_ok else "degraded"
|
||||
http_code = 200 if db_ok else 503
|
||||
return {"status": status, "service": "combined-api", "db": db_ok}, http_code
|
||||
|
||||
|
||||
@app.route("/")
|
||||
def index():
|
||||
return send_file("/home/h3r7/turf_saas/dashboard.html")
|
||||
|
||||
Reference in New Issue
Block a user