Reputation: 5017
I'm trying to access my localhost on my iphone to test my angular app but I can't get it to work. Anyone else figure this out?
I'm on a mac and my npm script looks like this
"start": "ng serve -e=local --host 0.0.0.0 --public --port 8000 --ssl",
and I'm trying to hit http://mymac.local:8000
on my phone, but it doesn't work
Upvotes: 1
Views: 2341
Reputation: 483
I ran into the same issue. The workaround is to use the --prod flag while serving your angular application.
Ex: ng serve --prod --host<Your IP>
P.S: This obviously takes more time(due to prod) to build and more time to reflect changes while debugging
Upvotes: 2