import os import sys from flask import Flask, render_template_string import markdown app = Flask(__name__) @app.route('/') @app.route('/health') def health_check(): try: readme_path = os.path.join(os.path.dirname(__file__), '..', 'README.md') verification_path = os.path.join(os.path.dirname(__file__), '..', 'VERIFICATION.md') readme_content = "" if os.path.exists(readme_path): with open(readme_path, 'r', encoding='utf-8') as f: readme_content = f.read() verification_content = "" if os.path.exists(verification_path): with open(verification_path, 'r', encoding='utf-8') as f: verification_content = f.read() html_readme = markdown.markdown(readme_content) if readme_content else "

README.md not found.

" html_verification = markdown.markdown(verification_content) if verification_content else "

VERIFICATION.md not found.

" return render_template_string(""" MQL5 Trading Automation Dashboard

System Status ONLINE

MQL5 Trading Automation is running.

{{ html_verification|safe }}

Project Documentation

{{ html_readme|safe }}
""", html_readme=html_readme, html_verification=html_verification, year=2026) except Exception as e: return f"Error: {str(e)}", 500 if __name__ == '__main__': port = int(os.environ.get('PORT', 8080)) print(f"Starting web dashboard on port {port}...") app.run(host='0.0.0.0', port=port)