H2P3B / main.py
muhammadshaheryar's picture
Update main.py
78a91ad verified
raw
history blame contribute delete
470 Bytes
import sys
import os
from pathlib import Path
import uvicorn
# Add the 'src' directory to the system path so imports like 'from database' work
src_path = str(Path(__file__).parent / "src")
if src_path not in sys.path:
sys.path.insert(0, src_path)
# Import the actual FastAPI app from the src folder
from src.main import app
if __name__ == "__main__":
port = int(os.getenv("PORT", 7860))
uvicorn.run("src.main:app", host="0.0.0.0", port=port, reload=False)