You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+42-11Lines changed: 42 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -169,39 +169,70 @@ The Vonage Video API Reference App for React is currently supported on the lates
169
169
170
170
## Testing on Multiple Devices
171
171
172
-
To test the video API across multiple devices on your local network, you can use **ngrok** to expose your frontend publicly.
172
+
To test the video API across multiple devices on your local network, you can use **ngrok** to expose your frontend and backend publicly.
173
173
174
-
1. Create an account at [ngrok](https://dashboard.ngrok.com/signup) if you haven’t already.
174
+
1. Create an account at [ngrok](https://dashboard.ngrok.com/signup) if you haven't already.
175
175
176
176
2. Follow the [Setup and Installation instructions](https://dashboard.ngrok.com/get-started/setup/) for your operating system to install and configure ngrok.
177
177
178
-
3. Create a secure tunnel to your frontend using:
178
+
3. **Start the application locally first:**
179
179
180
180
``` bash
181
-
yarn forward:frontend
181
+
yarn dev
182
+
```
183
+
184
+
Make sure both the backend server (port 3345) and frontend dev server (port 5173) are running before proceeding to the next step.
185
+
186
+
4. Create secure tunnels for both frontend and backend:
187
+
188
+
**Set up ngrok configuration:**
189
+
190
+
First, find your ngrok config file location:
191
+
``` bash
192
+
ngrok config check
193
+
```
194
+
195
+
Create or edit the ngrok configuration file (typically located at `~/Library/Application Support/ngrok/ngrok.yml` on macOS; `~/.config/ngrok/ngrok.yml` on Linux and `%HOMEPATH%\AppData\Local\ngrok\ngrok.yml` on Windows) with the following content:
196
+
197
+
``` yaml
198
+
version: "2"
199
+
tunnels:
200
+
frontend:
201
+
addr: 5173
202
+
proto: http
203
+
backend:
204
+
addr: 3345
205
+
proto: http
206
+
```
207
+
208
+
**Start both tunnels:**
209
+
``` bash
210
+
ngrok start backend frontend
182
211
```
183
212
184
-
This commandcreates a publicly accessible HTTPS URLforyour frontend. It will appearin your terminal, similar to the image below:
213
+
This command will create publicly accessible HTTPS URLs for both your frontend and backend. The output will appear in your terminal, similar to the image below:
4. Copy the domain from the output and update your **frontend/.env** file:
222
+
5. Copy the domains from both outputs and update your **frontend/.env** file:
194
223
195
224
``` ini
196
-
# example
197
-
VITE_TUNNEL_DOMAIN=GENERIC_DOMAIN
225
+
# Frontend tunnel domain
226
+
VITE_TUNNEL_DOMAIN=your-frontend-domain.ngrok.io
227
+
# Backend tunnel domain
228
+
VITE_API_URL=https://your-backend-domain.ngrok.io
198
229
```
199
230
200
-
**Note:** ngrok assigns a temporary domain. You’ll need to update your environment variable each time the domain changes.
231
+
**Note:** ngrok assigns temporary domains. You'll need to update your environment variables each time the domains change.
201
232
202
233
</br>
203
234
204
-
5. Open the provided **Forwarding** URL in your browser. This exposes your Vite app publicly. However, keep in mind that the backend server is still local, so the devices accessing the app must be on the same local network.
235
+
6. Open the provided frontend **Forwarding** URL in your browser. This exposes your entire application publicly, allowing devices on any network to access it.
0 commit comments