#!/usr/bin/env bash # Stable runner used by launchd/start.sh for the independent new2 backend. set -euo pipefail cd "$(dirname "$0")/.." ROOT="$(pwd)" env_value() { [ -f "$ROOT/.env" ] || return 0 grep -E "^$1=" "$ROOT/.env" | tail -1 | cut -d= -f2- } API_PORT="$(env_value API_PORT)" API_PORT="${API_PORT:-8102}" export PYTHONUNBUFFERED=1 exec python3 -m uvicorn app.main:app --host 0.0.0.0 --port "$API_PORT"