import os
import sys

# Ensure application root directory is the first entry in sys.path
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
if PROJECT_ROOT not in sys.path:
    sys.path.insert(0, PROJECT_ROOT)

# Import Flask application instance
# Phusion Passenger looks for the WSGI callable named 'application'
from app import app as application

if __name__ == "__main__":
    application.run()
