41 lines
772 B
Batchfile
41 lines
772 B
Batchfile
@echo off
|
||
echo ========================================
|
||
echo 鲸鱼镇 Web服务器 (web_assets)
|
||
echo ========================================
|
||
echo.
|
||
|
||
set "PORT=8000"
|
||
|
||
REM 检查Python
|
||
python --version >nul 2>&1
|
||
if %ERRORLEVEL% neq 0 (
|
||
echo [错误] 未找到Python!
|
||
echo 请安装Python: https://python.org/downloads
|
||
pause
|
||
exit /b 1
|
||
)
|
||
|
||
REM 检查文件
|
||
if not exist "web_assets\index.html" (
|
||
echo [错误] 未找到 web_assets\index.html
|
||
pause
|
||
exit /b 1
|
||
)
|
||
|
||
echo [启动] 启动服务器...
|
||
echo 端口: %PORT%
|
||
echo 目录: web_assets
|
||
echo.
|
||
echo 访问地址: http://localhost:%PORT%
|
||
echo.
|
||
echo 按 Ctrl+C 停止服务器
|
||
echo.
|
||
|
||
REM 启动服务器
|
||
cd web_assets
|
||
start http://localhost:%PORT%
|
||
python -m http.server %PORT%
|
||
|
||
cd ..
|
||
pause
|