Files
nxxmdata/backend/start-ngrok.bat
2025-09-12 20:08:42 +08:00

47 lines
1.1 KiB
Batchfile
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.

@echo off
echo 正在启动ngrok外网访问服务...
echo.
REM 检查ngrok是否存在
if not exist "ngrok.exe" (
echo 错误ngrok.exe 不存在请先下载ngrok
pause
exit /b 1
)
echo 请确保您已经:
echo 1. 注册了ngrok账号
echo 2. 获取了authtoken
echo 3. 运行了ngrok authtoken YOUR_AUTH_TOKEN
echo.
echo 选择要启动的服务:
echo 1. 前端服务 (端口5300)
echo 2. 后端服务 (端口5350)
echo 3. 同时启动前端和后端
echo.
set /p choice="请输入选择 (1-3): "
if "%choice%"=="1" (
echo 启动前端服务穿透...
.\ngrok.exe http 5300
) else if "%choice%"=="2" (
echo 启动后端服务穿透...
.\ngrok.exe http 5350
) else if "%choice%"=="3" (
echo 启动前端服务穿透...
start "Frontend" .\ngrok.exe http 5300
timeout /t 3 /nobreak >nul
echo 启动后端服务穿透...
start "Backend" .\ngrok.exe http 5350
echo.
echo 两个服务都已启动,请查看各自的窗口获取访问地址
) else (
echo 无效选择,请重新运行脚本
)
echo.
echo 按任意键退出...
pause >nul