Reputation: 1085
How do I host a node based website on my mac and access it from my iPhone? Both my mac(Sierra) and iPhone(iOS 10.3.3) are on the same wifi. I can see my website on my mac by going to http://localhost:3000/. I have already read many similar articles, but nothing has worked yet. I already tried using my computer name found in the sharing system preference. My computer name is hMac.local. So this means on my iPhone, I should be able to access it by typing http://hMac.local:3000/. But I can't. Safari hangs and then returns "Safari could not open the page because the server stopped responding". I turned the firewall off. There is obviously something I'm missing. Any ideas?
Upvotes: 0
Views: 332
Reputation: 24
this is a long thing to deal with. ive done it many times before. so basically, your mac is not set up to serve static files by default. in order to do so, you must configure your apache settings and write (inside it) which folder(s) (usually called, or named by u as, "Public" or "Site") are allowed to be accessed by other IP addresses (devices). i suggest you google a tutorial on "How to Setup a Nodejs Server on Mac"
Upvotes: 0