Files
led-controller/tests/web.py
Jimmy ace5770b3a refactor(api): complete fastapi migration and related features
Finish native FastAPI controllers, drop vendored microdot, and add
Wi-Fi driver runtime, beat SSE, simulated BPM, sequence playback
improvements, bridge ESP-NOW sources, UI updates, and tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-11 22:55:28 +12:00

36 lines
985 B
Python
Executable File

#!/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)