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

50 lines
1.3 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 ========================================
echo ngrok测试脚本无需认证
echo ========================================
echo.
echo 注意此脚本使用ngrok的免费版本
echo 每次重启ngrokURL会发生变化
echo.
echo 选择要测试的服务:
echo 1. 后端服务 (端口5350)
echo 2. 前端服务 (端口5300)
echo 3. 同时启动两个服务
echo.
set /p choice="请输入选择 (1-3): "
if "%choice%"=="1" (
echo 启动后端服务穿透...
echo 请在新窗口中查看访问地址
start "ngrok-backend" .\ngrok.exe http 5350
) else if "%choice%"=="2" (
echo 启动前端服务穿透...
echo 请在新窗口中查看访问地址
start "ngrok-frontend" .\ngrok.exe http 5300
) else if "%choice%"=="3" (
echo 启动后端服务穿透...
start "ngrok-backend" .\ngrok.exe http 5350
timeout /t 2 /nobreak >nul
echo 启动前端服务穿透...
start "ngrok-frontend" .\ngrok.exe http 5300
) else (
echo 无效选择
goto end
)
echo.
echo ========================================
echo ngrok已启动
echo ========================================
echo.
echo 请查看新打开的窗口获取访问地址
echo 访问地址格式https://xxxxx.ngrok.io
echo.
:end
echo 按任意键退出...
pause >nul