My mobile app uses an API from a url say example.com
.
However I want it to use my local development version that's on my machine which is example.dev
.
I set this up on my machine by adding the following to my routes file:
192.168.10.10 example.dev
The ip: 192.168.10.10
directs to a VM (more specifically Laravel's Homestead).
This means when I type example.dev
on my desktop web browser, it directs me to the VM.
I want it so that when I type example.dev
on my mobile browser, it will also direct me to the VM on my desktop.
Note that both the mobile phone and desktop are on the same network.
Progress so far
After going through loads of SO answers I have found the followinG;
- I can use my local IP address (e.g.
192.168.0.50
) to access mylocalhost
. However, I want to access the VM, not localhost! - Use
vagrant share
, but this just creates a 400 Bad request error, which apparently is still an open issue! - Add the local ip to the map attribute on
homestead.yaml
. However I can only access the website like this:192.168.0.50:8000
. Also not sure how I can add more sites using this approach?