#!/usr/bin/env python3 """Local development server: FastAPI app on port 5000.""" from __future__ import annotations import os import sys PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) SRC_PATH = os.path.join(PROJECT_ROOT, "src") sys.path.insert(0, SRC_PATH) os.chdir(SRC_PATH) import importlib.util spec = importlib.util.spec_from_file_location( "settings", os.path.join(SRC_PATH, "settings.py") ) settings_module = importlib.util.module_from_spec(spec) sys.modules["settings"] = settings_module spec.loader.exec_module(settings_module) settings_module.Settings.SETTINGS_FILE = os.path.join(PROJECT_ROOT, "settings.json") if __name__ == "__main__": import uvicorn from fastapi_app import app print("Starting LED Controller Web Server (Local Development)") print("=" * 60) print("Server will run on http://localhost:5000") print("Press Ctrl+C to stop") print("=" * 60) uvicorn.run(app, host="0.0.0.0", port=5000)