From ce6b0684c8dc2e2199980bffc458a26dba0347d1 Mon Sep 17 00:00:00 2001 From: VivianDee <115420678+VivianDee@users.noreply.github.com> Date: Fri, 10 Oct 2025 16:15:41 +0100 Subject: [PATCH] [add]: DB_URI --- app/api/routes/routes.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/api/routes/routes.py b/app/api/routes/routes.py index 364cf74..38b1052 100644 --- a/app/api/routes/routes.py +++ b/app/api/routes/routes.py @@ -23,6 +23,7 @@ from flask_jwt_extended import ( from sqlalchemy import text from app.extensions import db from app.config import settings +from urllib.parse import urlparse api = Blueprint("api", __name__) @@ -128,6 +129,14 @@ def health_check(): errors = [] status = "ok" + # Extract the database URI + try: + db_uri = db.engine.url.render_as_string(hide_password=False) + db_uri = db_uri + except Exception as e: + db_uri = "Unavailable" + + # Check database connection try: db.session.execute(text("SELECT 1")) @@ -156,6 +165,7 @@ def health_check(): response = { "status": status, "db_status": db_status, + "db_uri": db_uri, "events_service_status": events_service_status, "errors": errors or None }