WeChat custom robot background express message decoding plugin
Recently, in the background of building our own WeChat official account robot, after the user sends a small message to the official account, it will be forwarded to the server set by the WeChat server level. At the beginning, we can choose the plaintext mode, but for safety reasons, we will still turn on Safe mode, in this mode, all messages will be encrypted as a whole, we need to decrypt them at the server level, and the WeChat official doc is not well written, and there is no example code for the nodejs version, so I combined the example code to make a version of express plug-in, record it: