Skip to content

Commit 5b8e98e

Browse files
committed
Add one-click Windows script for Streamlit + public Cloudflare link
1 parent 81ebd46 commit 5b8e98e

2 files changed

Lines changed: 49 additions & 0 deletions

File tree

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ A deep learning project that fine-tunes DistilBERT for binary sentiment classifi
1212

1313
Note: the current public link is a Cloudflare quick tunnel (no card needed). It stays live while the cloudflared process is running on this machine.
1414

15+
### One-Click Public Link (Windows)
16+
17+
Run `start_public_link.bat` from the project root. It starts:
18+
- Streamlit on localhost:8501
19+
- Cloudflare quick tunnel for a public HTTPS URL
20+
21+
Keep both opened terminal windows running while sharing the app.
22+
1523
## Quick Start - Run Locally
1624

1725
### Prerequisites

start_public_link.bat

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
@echo off
2+
setlocal
3+
4+
cd /d "%~dp0"
5+
6+
echo ========================================
7+
echo Start Streamlit + Public Link
8+
echo ========================================
9+
echo.
10+
11+
set "CLOUDFLARED_CMD=cloudflared"
12+
where cloudflared >nul 2>&1
13+
if errorlevel 1 (
14+
if exist "C:\Program Files (x86)\cloudflared\cloudflared.exe" (
15+
set "CLOUDFLARED_CMD=C:\Program Files (x86)\cloudflared\cloudflared.exe"
16+
) else if exist "C:\Program Files\cloudflared\cloudflared.exe" (
17+
set "CLOUDFLARED_CMD=C:\Program Files\cloudflared\cloudflared.exe"
18+
) else (
19+
echo ERROR: cloudflared is not installed.
20+
echo Install with:
21+
echo winget install --id Cloudflare.cloudflared -e --accept-source-agreements --accept-package-agreements
22+
echo.
23+
pause
24+
exit /b 1
25+
)
26+
)
27+
28+
echo Starting Streamlit app on http://localhost:8501 ...
29+
start "Streamlit App" cmd /k "cd /d %CD% && streamlit run app.py"
30+
31+
echo Waiting for app startup...
32+
timeout /t 6 /nobreak >nul
33+
34+
echo Starting Cloudflare public tunnel...
35+
start "Cloudflare Tunnel" cmd /k "cd /d %CD% && "%CLOUDFLARED_CMD%" tunnel --url http://localhost:8501"
36+
37+
echo.
38+
echo Open the "Cloudflare Tunnel" window and copy the https://*.trycloudflare.com link.
39+
echo Keep both windows open while sharing the app.
40+
echo.
41+
pause

0 commit comments

Comments
 (0)