import os
from main import app

if __name__ == "__main__":
    # This allows running the app directly with 'python wsgi.py'
    # For production, use a WSGI server like Gunicorn:
    # gunicorn --bind 0.0.0.0:8000 wsgi:app
    port = int(os.environ.get('PORT', 8000))
    app.run(host='0.0.0.0', port=port)
