from flask import Response, current_app from sqlalchemy import create_engine def health() -> Response: try: db_url = current_app.config['SQLALCHEMY_DATABASE_URI'] create_engine(db_url).execute('SELECT 1;') return Response(status=200) except Exception: # pylint: disable=broad-except return Response(status=500)