Files
operating-room-monitor-server/clients/voice-confirmation/start.sh

22 lines
753 B
Bash
Raw Normal View History

#!/usr/bin/env bash
# 语音确认静态页入口。勿用 file:// 打开(麦克风等行为异常)。
# 用法:
# ./start.sh [端口] 默认:./start_http.sh
# ./start.sh --single [端口] 打包 dist/ 后等价于 dist/start_http.sh
# VOCH_HTTP_BIND=127.0.0.1 可仅监听本机;默认 0.0.0.0 供局域网终端访问
set -euo pipefail
ROOT="$(cd "$(dirname "$0")" && pwd)"
cd "$ROOT"
if [ "${1:-}" = "--single" ]; then
shift
PORT="${1:-8080}"
BIND="${VOCH_HTTP_BIND:-0.0.0.0}"
python3 scripts/bundle_single_html.py
VOCH_HTTP_BIND="${BIND}" exec bash "${ROOT}/dist/start_http.sh" "$PORT"
fi
PORT="${1:-8080}"
BIND="${VOCH_HTTP_BIND:-0.0.0.0}"
VOCH_HTTP_BIND="${BIND}" exec bash "${ROOT}/start_http.sh" "$PORT"