Skip to content

Commit

Permalink
📖 update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
songquanpeng committed Sep 12, 2020
1 parent 5f75f7f commit 24a91b6
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
2. 下载代码:`git clone https://github.com/songquanpeng/wechat-message-push.git`
3. 安装依赖:`npm i`
4. 安装 pm2:`npm i -g pm2`
5. 使用 Nginx 反代我们的 Node.js 服务,默认端口 3000。
5. 使用 pm2 启动服务:`pm2 start ./app.js --name wechat-message-push-service`
6. 使用 Nginx 反代我们的 Node.js 服务,默认端口 3000。
1. 修改应用根目录下的 `nginx.conf` 中的域名以及端口号,并创建软链接:`sudo ln -s ./nginx.conf /etc/nginx/site-enabled/wechat-push-service.conf`
2. 之后使用 [certbot](https://certbot.eff.org/lets-encrypt/ubuntuxenial-nginx) 申请证书:`sudo certbot --nginx`
3. 重启 Nginx 服务:`sudo service nginx restart`
Expand All @@ -17,9 +18,9 @@
1. 首先前往[此页面](https://mp.weixin.qq.com/debug/cgi-bin/sandboxinfo?action=showinfo&t=sandbox/index)拿到 APP_ID 以及 APP_SECRET。
2. 使用微信扫描下方的测试号二维码,拿到你的 OPEN_ID。
3. 新增模板消息模板,模板标题随意,模板内容填 `{{text.DATA}}`,提交后可以拿到 TEMPLATE_ID。
4. 填写接口配置信息,URL 填 `https://你的域名/verify`,TOKEN 随意,之后点击验证。
4. 填写接口配置信息,URL 填 `https://你的域名/verify`,TOKEN 随意,先不要点击验证。
5. 现在访问 `https://你的域名/`,填写表单,之后点击提交按钮。
6. 之后回到微信公众平台测试号的配置页面,点击验证。

### 应用内配置
1. 使用 pm2 启动应用:`pm2 start ./app.js --name wechat-message-push-service`
2. 访问首页填写配置项并提交。
2. 之后访问 `https://你的域名/Hi``https://你的域名/push?content=Hi`,如果你的微信能够收到一条内容为 Hi 的模板消息,则配置成功。
### 验证是否配置成功
访问 `https://你的域名/Hi``https://你的域名/push?content=Hi`,如果你的微信能够收到一条内容为 Hi 的模板消息,则配置成功。

0 comments on commit 24a91b6

Please sign in to comment.