run_api_server.py•825 B
#!/usr/bin/env python3
"""
Entry point script for TimeLooker Task Manager API Server.
This script properly sets up the module path and runs the FastAPI server.
"""
import sys
import os
# Add the current directory to Python path to enable src imports
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
if __name__ == "__main__":
# Import and run the API server
import uvicorn
import logging
from src.api.task_manager_api import app
# Get configuration from environment
API_HOST = os.getenv("API_HOST", "0.0.0.0")
API_PORT = int(os.getenv("API_PORT", "8000"))
logger = logging.getLogger(__name__)
logger.info(f"Starting TimeLooker Task Manager API Server on {API_HOST}:{API_PORT}")
# Run the FastAPI server
uvicorn.run(app, host=API_HOST, port=API_PORT)