vite
package.json
//change vite --host
'scripts':{
'dev':'vite --host',
}
//initially vite runs on local server only.
npm run dev #start vite server
live server extension
If you are not using any framework then This extension might help.
//download live server on VSCode[available for other IDE]
//1. right click
//2. start live server
ipconfig #windows
#copy ipv4 address with port number
#http://192.168.87.148:5173/
create react app
npm start --host 192.168.1.111 # you can start custom react app using --host flag
type on phone
#192.168.1.111:3000 # get your host on react terminal
How to find your IP address
for mac
System Preferences can be accessed by opening the Apple menu.
Select Network from the View menu by opening it, or click Network in the System Preferences window.
On the left menu, select your network connection.
The local IP address for an Ethernet or USB connection will be displayed.
In the connection status section for a Wi-Fi connection, your IP address will be displayed.
for linux
ifconfig
note
: You must be on same network by either USB or wifi.
learning resources
🧡Scaler - India's Leading software E-learning
🧡w3schools - for web developers
Top comments (0)