| #!/usr/bin/env python3 | |
| """ | |
| Enhanced DOCX to PDF Converter - Application Entry Point | |
| """ | |
| import os | |
| import sys | |
| from pathlib import Path | |
| # Add src directory to Python path | |
| sys.path.insert(0, str(Path(__file__).parent.parent.parent)) | |
| from src.api.main import app | |
| if __name__ == "__main__": | |
| import uvicorn | |
| # Get port from environment variable or default to 7860 for Hugging Face compatibility | |
| port = int(os.environ.get("PORT", 7860)) | |
| uvicorn.run( | |
| "src.api.main:app", | |
| host="0.0.0.0", | |
| port=port, | |
| reload=False, | |
| workers=4 | |
| ) |