first
This commit is contained in:
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
VENV_DIR="${ROOT}/.venv"
|
||||
PY_BIN="${VENV_DIR}/bin/python"
|
||||
|
||||
if [ ! -x "${PY_BIN}" ]; then
|
||||
echo "[run_demo] Creo virtualenv in ${VENV_DIR}..."
|
||||
python3 -m venv "${VENV_DIR}"
|
||||
fi
|
||||
|
||||
if ! "${PY_BIN}" -c "import apipilot" >/dev/null 2>&1; then
|
||||
echo "[run_demo] Installo apipilot in modalità editabile + dipendenze test..."
|
||||
"${PY_BIN}" -m pip install --upgrade pip >/dev/null
|
||||
"${PY_BIN}" -m pip install -e "${ROOT}[test]"
|
||||
fi
|
||||
|
||||
"${PY_BIN}" -m pip install -q uvicorn >/dev/null 2>&1 || true
|
||||
|
||||
echo "[run_demo] Avvio demo backend su http://127.0.0.1:9292 (Ctrl+C per fermarlo)"
|
||||
cd "${ROOT}"
|
||||
exec "${PY_BIN}" -m uvicorn examples.demo_backend:app --host 0.0.0.0 --port 9292 --reload
|
||||
Reference in New Issue
Block a user