2026-05-10 12:56:30 -07:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
# Local static explorer with SPA path fallback (/institution, /compare, /addresses/… → index.html).
|
|
|
|
|
# Usage: SERVE_BIND=0.0.0.0 ./scripts/serve-explorer-local.sh [port]
|
|
|
|
|
# Requires: Python 3.7+
|
2026-02-10 11:32:49 -08:00
|
|
|
|
2026-05-10 12:56:30 -07:00
|
|
|
set -euo pipefail
|
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
|
|
PORT="${1:-8080}"
|
|
|
|
|
BIND="${SERVE_BIND:-127.0.0.1}"
|
2026-02-10 11:32:49 -08:00
|
|
|
|
2026-05-10 12:56:30 -07:00
|
|
|
if ! command -v python3 >/dev/null 2>&1; then
|
|
|
|
|
echo "python3 required" >&2
|
|
|
|
|
exit 1
|
2026-02-10 11:32:49 -08:00
|
|
|
fi
|
|
|
|
|
|
2026-05-10 12:56:30 -07:00
|
|
|
exec python3 "$SCRIPT_DIR/serve_explorer_spa.py" "$PORT" --bind "$BIND"
|