Files
notify-bridge/scripts/restart-backend.sh
T
alexei.dolgolyov 734e5c9340 feat: UX improvements — secure webhooks, locale fixes, dynamic languages, UI polish
- Remove top paginator from dashboard events, keep only bottom
- Fix test message locale: pass UI locale to email/matrix bot tests
- Convert webhook auth mode from text input to icon grid selector
- Generate secure UUID tokens for webhook URLs instead of sequential IDs
- Move Recent Payloads into per-provider expandable container (lazy-loaded)
- Make template config languages dynamic via app settings instead of hardcoded
- Change default dev port to 5175
2026-04-11 02:14:15 +03:00

40 lines
1.1 KiB
Bash

#!/usr/bin/env bash
# Restart the backend dev server.
# Usage: bash scripts/restart-backend.sh
cd "$(dirname "$0")/.."
# Kill existing backend
PID=$(netstat -ano 2>/dev/null | grep ':8420.*LISTENING' | awk '{print $5}' | head -1)
if [ -n "$PID" ]; then
taskkill //F //PID "$PID" 2>/dev/null || true
sleep 1
fi
# Resolve python — prefer py launcher on Windows (python3 may be the Store stub)
if command -v py &>/dev/null; then
PYTHON=$(py -3 -c "import sys; print(sys.executable)" 2>/dev/null)
elif command -v python3 &>/dev/null && python3 --version &>/dev/null; then
PYTHON=python3
elif command -v python &>/dev/null && python --version &>/dev/null; then
PYTHON=python
else
echo "Python not found"; exit 1
fi
# Start backend
export NOTIFY_BRIDGE_DATA_DIR=./test-data
export NOTIFY_BRIDGE_SECRET_KEY=test-secret-key-minimum-32chars
nohup "$PYTHON" -m uvicorn notify_bridge_server.main:app \
--host 0.0.0.0 --port 8420 > .backend.log 2>&1 &
sleep 3
if curl -sf http://localhost:8420/api/health; then
echo ""
echo "Backend started (PID $!)"
else
echo "Backend failed to start. Log:"
tail -20 .backend.log
exit 1
fi