Files
Seg_Data_Server_Net/scripts/run_frontend.sh
2026-06-30 17:33:15 +08:00

18 lines
380 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
if [[ -f "${ROOT_DIR}/.env" ]]; then
set -a
# shellcheck disable=SC1091
source "${ROOT_DIR}/.env"
set +a
fi
HOST="${SEG_FRONTEND_HOST:-0.0.0.0}"
PORT="${SEG_FRONTEND_PORT:-5173}"
cd "${ROOT_DIR}/frontend"
npm install
exec npm run dev -- --host "${HOST}" --port "${PORT}"