35 lines
822 B
Batchfile
35 lines
822 B
Batchfile
@echo off
|
|
cd /d "%~dp0"
|
|
|
|
where node >nul 2>nul
|
|
if errorlevel 1 (
|
|
echo [错误] 未找到 node,请先安装 Node.js 或将其加入 PATH。
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
if not defined PORT set "PORT=9109"
|
|
if defined GATEWAY_TOKEN (
|
|
set "TOKEN=%GATEWAY_TOKEN%"
|
|
) else (
|
|
set /p TOKEN=<token.txt
|
|
)
|
|
|
|
echo ============================================
|
|
echo Token: %TOKEN%
|
|
echo URL: http://localhost:%PORT%/?token=%TOKEN%
|
|
echo Docs: http://localhost:%PORT%/docs?token=%TOKEN%
|
|
echo MCP: http://localhost:%PORT%/mcp?token=%TOKEN%
|
|
echo ============================================
|
|
echo.
|
|
|
|
node gateway.js
|
|
if errorlevel 1 (
|
|
echo.
|
|
echo [错误] gateway 启动失败,退出码 %errorlevel%。
|
|
echo 常见原因:端口被占用。可运行以下命令查看占用进程:
|
|
echo netstat -ano ^| findstr :9109
|
|
pause
|
|
exit /b %errorlevel%
|
|
)
|