import os
import sys

# cPanel's Passenger invokes this file from an unpredictable working
# directory — without this, `from app.main import ...` below would
# fail to find the app package at all.
sys.path.insert(0, os.path.dirname(__file__))

# Passenger 6+ auto-detects an ASGI callable here and runs it natively
# (WebSocket support included, needed for app.api.v1.endpoints.tracking).
# On an older Passenger that only understands WSGI, this app instance
# would still get called, but any WebSocket connection would fail —
# check that specifically once this is live.
from app.main import app as application  # noqa: E402,F401 -- Passenger reads this module-level name itself
