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

44 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 ========================================
echo ngrok外网访问演示脚本
echo ========================================
echo.
echo 步骤1检查ngrok是否已配置认证
.\ngrok.exe config check
echo.
echo 步骤2如果没有配置请先运行以下命令
echo .\ngrok.exe authtoken YOUR_AUTH_TOKEN
echo.
echo 步骤3启动后端服务穿透
echo 正在启动ngrok...
echo 请在新窗口中查看访问地址
echo.
start "ngrok-backend" .\ngrok.exe http 5350
echo.
echo 步骤4等待3秒后启动前端服务穿透
timeout /t 3 /nobreak >nul
start "ngrok-frontend" .\ngrok.exe http 5300
echo.
echo ========================================
echo ngrok已启动
echo ========================================
echo.
echo 请查看两个新打开的窗口:
echo 1. ngrok-backend 窗口:显示后端访问地址
echo 2. ngrok-frontend 窗口:显示前端访问地址
echo.
echo 访问地址格式:
echo - 后端https://xxxxx.ngrok.io
echo - 前端https://yyyyy.ngrok.io
echo - API文档https://xxxxx.ngrok.io/api-docs
echo.
echo 按任意键退出...
pause >nul