Deploy prep

This commit is contained in:
Koncept Kit
2025-12-05 18:55:53 +07:00
parent 0de11c0e80
commit 2c6c56f44c

28
main.py Normal file
View File

@@ -0,0 +1,28 @@
"""
Main entry point for the FastAPI application.
Starts uvicorn server with PORT from .env file.
"""
import os
import uvicorn
from dotenv import load_dotenv
from pathlib import Path
# Load environment variables
ROOT_DIR = Path(__file__).parent
load_dotenv(ROOT_DIR / '.env')
if __name__ == "__main__":
# Get port from environment variable, default to 8000
port = int(os.getenv("PORT", 8000))
host = os.getenv("HOST", "0.0.0.0")
print(f"🚀 Starting server on {host}:{port}")
uvicorn.run(
"server:app",
host=host,
port=port,
reload=True, # Enable auto-reload during development
log_level="info"
)