. ├── README.md ├── package.json // Build project and toolkit dependencies ├── config.json // Project configuration file ├── app.js // Project startup entrance ├── wechat // WeChat module folder │ ├── access_token.json // accessToken storage file │ ├── menus.json // Menu configuration file │ ├── msg.js // Message module │ └── wechat.js // WeChat module
Clone the project locally
git clone [email protected]:SilenceHVK/wechatByNode.git
Open the project configuration file config.json
Modify the file's token, appID, and appScrect configuration parameters. The two parameters token, appID and appScrect are located in the basic configuration of the left menu of the WeChat public platform.
Go into wechatByNode file and run app.js
cd wechatByNode && node app.js // Server runs at localhost:3000
Map the service address to the external network or deploy it to the server. Here I use intranet penetration demonstration.
Open the Peanut Shell software and click intranet penetration
Click Add Mapping
Configure mapping because WeChat only accepts port 80. The mapping type must be port 80, and the intranet host is the IP address of the computer where the Node.js project is deployed.
Access authentication
Click Submit. It prompts that the submission is successful and the access authentication is completed.
Scan the WeChat QR code and follow the official account to start playing