It is invalid to use ng server to start other people's access in the local area network in the angular4 project.

after using ng server in angular4 project, you can open it locally with localhost:4200. In the local area network, others can"t access my project with my local area network address.

Feb.28,2021

run ng serve-host xxx.xxx.x.xxx (your own ip address), and then you can access it through your ip address.
seems to be configurable in the project. If configured, you can run ng serve directly. I forgot how to do it.


localhost is actually a domain name, similar to baidu.com . The corresponding IP address is usually 127.0.0.1, which can only be accessed by local applications on your own computer, even in the same local area network. He typed localhost into his browser to access applications on his computer. So you can follow the practice upstairs, set up your application from the server's ip is the IP address of your computer, so that other people on the same local area network can access it.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e9e108-19a3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e9e108-19a3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?