One, download ngrok
Go to the official website to download ngrok:
https://ngrok.com/download
Two, configure ngrok
Enter the terminal and execute the following command:
open -e .bash_profile
Modify .bash_profile (subject to the actual installation directory):
export PATH=${PATH}:/Users/xuxiansheng/Desktop/express_project/ngrok
In the terminal, execute the following command:
source .bash_profile
Three, run ngrok
Execute the following commands in the terminal:
ngrok http 80
Results:
PS: If you are running a web application with port 80 on your computer, you can access it through the generated corresponding domain name (eg: fad8420.ngrok.io).