These changes will work for accessing a local deploy on another device on the same network.
-
Find the IP of the machine running vets-api and vets-website, i.e
192.168.x.x. The IP of the machine may look like10.0.x.xor172.16.x.xinstead- Mac
- System Preferences > Network
- Click the connection you are using to connect to the internet
- Look for
Status, underneath the laptop's IP address will be listed, i.e192.168.x.x
- Windows - https://support.microsoft.com/en-us/help/4026518/windows-10-find-your-ip-address
- Mac
-
Run vets-website so that devices on your local network can access it
yarn watch --env.host 0.0.0.0 --env.public 198.162.x.x:3001 -
In
settings.local.yml- Add
http://192.168.x.x:3000andhttp://192.168.x.x:3001toweb_origin - Add
"192.168.x.x"tovirtual_hosts - Set
virtual_host_localhostto192.168.x.x
# For CORS requests; separate multiple origins with a comma web_origin: http://192.168.x.x:3000, http://192.168.x.x:3001 virtual_hosts: ["127.0.0.1", "localhost", "192.168.x.x"] virtual_host_localhost: 192.168.x.x - Add
-
Make sure to rebuild vets-api before starting
make rebuild; make up; -
From a device on the same network go to
192.168.x.x:3001