"""cPanel / Passenger entry point.

cPanel's "Setup Python App" points here. Passenger imports `application`,
which is the ASGI app wrapped by a2wsgi so it can run under WSGI.
"""
import sys
from pathlib import Path

BASE_DIR = Path(__file__).resolve().parent
sys.path.insert(0, str(BASE_DIR))

from app.main import app  # noqa: E402

try:
    from a2wsgi import ASGIMiddleware

    application = ASGIMiddleware(app)
except ImportError:  # pragma: no cover - only when running under uvicorn/gunicorn
    application = app
