Access angular mobile phone project

To implement mobile access to locally developed mobile terminal project, first do two things:

1, open the local project can use the local ip access

2, a mobile phone and computer simultaneously in the same local area network (mobile phones and computers connected simultaneously to the same wifi / hot open phone to the computer / phone connection to a wifi computer-Open)

If you do the above two points, then congratulations, you can directly use the computer terminal in the mobile ip visit.

 

Because now is the angular + ionic development projects, so the following settings are angular and development of project-based settings. The following first to solve the first problem:

A, Angular project configuration and can be used simultaneously localhost ip local access, the following steps:

step1: locate the file "node_modules / webpack-dev-server / lib / Server.js", according to the modification of FIG.

The revised to return false return true;

 

step2: modify the configuration file package.json

 

 

 step2: Restart Project

So far you can directly use the machine IP: 4200 or localhost: 4200 Project visit friends.

The first problem is now solved the problem, so let's look at how to access local angualr project by moving the end. Has been said above, need mobile phones and computers within the same LAN, we describe three methods, the computer is now only open wifi connection to the mobile phone as an example to explain the other two similar manner.

 

Second, the mobile phone is connected end computer test page locally developed

step1: Turn off the computer firewall

Or allow the connection port 80;
settings:
open the control panel -Windows Firewall - Advanced Settings - inbound rules - New Rules - Port - Input 80

 

 

 step2: Turn on the computer hotspot

In the lower right corner of the computer network settings area, right = "open" Network and Internet "settings, open the following page:

 

 

 

 When enabled, the word can be connected device connected to the local area to see the mobile phone terminal

step3: Check that your computer can communicate with the phone

Command Prompt cmd - "(the graph is connected)
of ping assigned IP

 step4: How to get the computer ip  

Command Prompt cmd - "ipconfig

 1. If the computer is connected to the Internet using a wired network.
IP address of the mobile terminal should be entered IP Ethernet card (select one of the interfaces, and the other is standby)

 

 2. If the computer using a wireless network connection to the Internet
phone side should enter the IP address is the IP wireless network card (you can select one of IPV4).

 

 At this point, you can use the phone to access the

 

 Perfect end to complete the mobile phone to access the mobile computer local development projects.

Guess you like

Origin www.cnblogs.com/x123811/p/11518471.html