background
Using NodeJS for WeChat public account development, you first need to respond to the Token verification sent by WeChat, official documents
Fill out the server configuration
Log in to the WeChat public platform and open the page in the basic configuration under development.
Fill in the URL of the interface, the custom Token in turn, click Randomly Generate to generate EncodingAESKey, select the message encryption method as plaintext mode, and WeChat will perform the server's Token verification when clicking Submit.
Response to Token verification sent by WeChat
The project is developed using express, and the middleware wechatAuth is as follows:
1 |
var app = express(); |
After the server goes online, click the basic configuration to open the submit in this page.