Files
MetonaToast/serve.sh
T

33 lines
691 B
Bash

#!/bin/bash
# MetonaToast 本地开发服务器
echo "🍞 MetonaToast 开发服务器"
echo "========================="
# 检查Python
if command -v python3 &> /dev/null; then
PYTHON=python3
elif command -v python &> /dev/null; then
PYTHON=python
else
echo "❌ 错误: 未找到Python"
exit 1
fi
PORT=${1:-3000}
echo "✅ Python: $($PYTHON --version 2>&1)"
echo "🌐 启动服务器..."
echo ""
echo "📁 访问地址:"
echo " http://localhost:$PORT/site/index.html"
echo " http://localhost:$PORT/site/demo.html"
echo " http://localhost:$PORT/site/docs.html"
echo ""
echo "按 Ctrl+C 停止服务器"
echo ""
cd "$(dirname "$0")"
$PYTHON -m http.server $PORT