import sys
import os

# Add venv site-packages to sys.path so the server can find dependencies
venv_path = os.path.join(os.path.dirname(__file__), 'venv')
if os.path.exists(venv_path):
    import glob
    # Find the site-packages directory (e.g., venv/lib/python3.11/site-packages)
    site_packages = glob.glob(os.path.join(venv_path, 'lib', 'python*', 'site-packages'))
    if site_packages:
        sys.path.insert(0, site_packages[0])

from app import app

if __name__ == "__main__":
    app.run(host='0.0.0.0', port=8080)
