web
This commit is contained in:
29
web/start.sh
Normal file
29
web/start.sh
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo ""
|
||||
echo "========================================"
|
||||
echo " 电商PC端项目启动"
|
||||
echo "========================================"
|
||||
echo ""
|
||||
echo "正在启动本地服务器..."
|
||||
echo ""
|
||||
echo "请在浏览器中访问: http://localhost:8000"
|
||||
echo ""
|
||||
echo "按 Ctrl+C 停止服务器"
|
||||
echo ""
|
||||
echo "========================================"
|
||||
echo ""
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
# 检查是否安装了 Python
|
||||
if command -v python3 &> /dev/null; then
|
||||
echo "使用 Python 启动服务器..."
|
||||
python3 -m http.server 8000
|
||||
elif command -v python &> /dev/null; then
|
||||
echo "使用 Python 启动服务器..."
|
||||
python -m http.server 8000
|
||||
else
|
||||
echo "Python 未安装,尝试使用 npx http-server..."
|
||||
npx http-server -p 8000
|
||||
fi
|
||||
Reference in New Issue
Block a user