Micro mall debugging

 

    When wechat is developing, we must enter a URL, and the URL must be an external domain name. We cannot debug locally, which brings us great inconvenience. The system is prone to bugs during the development stage. If the version on the server is It's already running, and we can't develop and debug on that basis, so it's important to be able to develop WeChat locally.


1. Find an Internet server

 

2. To solve the local development of WeChat, a key problem is to be able to map the local IP address to the public network, find relevant solutions from the Internet, and finally solve it easily with ngrok, visit the official website ngrok - secure introspectable tunnels to localhost Download ngrok, there is only one file ngrok.exe after decompression




3. windows-->run-->cmd, enter the root directory of ngrok.exe, enter ngrok 80, so that the local 127.0.0.1:80 can be assigned a domain name that can be accessed by the external network



4. Unfortunately, the domain name is random and will change every time it restarts, which is not conducive to our WeChat debugging, so we hope to fix the domain name, check the ngrok official website carefully, ngrok has given us a solution, we need to register it.



5. After successful registration, you will get a token



6. Still in windows-->run-->cmd, enter the ngrok.exe directory and enter:


ngrok -authtoken token 80

The token is replaced with the value returned after we registered, and after pressing Enter, it starts successfully


7. But the returned token is too long to be remembered, so let's change a name that is easy to remember and enter


ngrok -subdomain leopard 80


8. After pressing Enter, it starts successfully. Next, we need to verify the input domain name: whether it can pass the URL verification of WeChat


Steps to read


9. 8


Open the WeChat public platform, select the developer center, enter the relevant content in the form on the right, and enter the domain name we just set in the URL


10. 9


The submission is successful, indicating that our settings are valid. At this time, we can see the return value under the get method in tomcat.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326423503&siteId=291194637