localhostfor your machine's local IP address; that new URL will serve to any network-connected device
While building sites, your content should always be easily accessible regardless of the user's device size, speed or type. It is much easier to build in the responsive design from the beginning, rather than the trap we often fall into where we develop on blazingly fast desktop machines hooked up to ethernet, and then wonder why the site barely functions on an older mobile phone via crappy 3G connection.
Thankfully, it's pretty painless to view your local development from one machine (like your laptop) on another machine (like your iPhone). Follow the steps below (for Mac but they'd be similar on any OS) to start seeing your dev site on a true mobile device!
- Find your computer's local IP address:
- Open “Network settings”
- Highlight and copy the IP address (using right click -> copy, NOT cmd-C)
- Start your local dev server, launch browser and view the site in progress. For
create-react-appit would be
localhostwith the computer's IP address, but keep the port (the
:3000), and confirm the same site loads. My app’s new url would be
- Done! Copy-paste that new address and send it to any iPhone, Android, tablet, smartTV, whatever! As long as the device is on the same network as your computer running the dev server, it should work.