Files
gitlab-instance-0a899031_sh/d2ypp2/web.sh
root 07aa02bca6 s
2026-05-17 04:31:59 +00:00

17 lines
515 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# 兼容入口默认一键开发API + Next。仅后端: WEB_STACK=api ./web.sh
# 生产部署请用: ./start.sh
set -euo pipefail
cd "$(dirname "$0")"
export PORT="${PORT:-8001}"
if [[ -x ".venv/bin/python" ]]; then
PY=".venv/bin/python"
else
PY=python3
command -v python3 >/dev/null 2>&1 || PY=python
fi
if [[ "${WEB_STACK:-}" == "api" ]]; then
exec "$PY" scripts/launch.py --api-only --host 0.0.0.0 --port "$PORT" --reload
fi
exec "$PY" scripts/launch.py --dev --port "$PORT"