Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

connecting to the vapor server running on Mac using iPhone

I have a web app developed using server side swift vapor 3 running locally on my Mac. I want to access it using my iPhone on the same wifi as my Mac. How can I do that. I tried using http://<the ip of my Mac on local network>:8080 but didn't work, even with firewall completely off. Thanks in advance.

like image 997
Alan Avatar asked Jun 14 '19 18:06

Alan


2 Answers

Add the keyword 'serve' for vapor 4.

enter image description here

like image 192
lukaskasa Avatar answered Oct 28 '22 22:10

lukaskasa


Edit you Run scheme in Xcode and put --hostname 0.0.0.0 --port 8080 into Arguments Passed On Launch

enter image description here

enter image description here

Then launch you server and try to reach it by http://<the ip of your Mac on local network>:8080

NOTE: 0.0.0.0 means that your server will listen on all network interfaces

like image 42
imike Avatar answered Oct 28 '22 23:10

imike