Skip to content

Commit

Permalink
🔀 Merge pull request #4 from Ecalose/master
Browse files Browse the repository at this point in the history
  • Loading branch information
songquanpeng authored Jan 31, 2021
2 parents d41a78b + 9473d41 commit f3b6b74
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
## 在 Heroku 上的搭建步骤
在此之前,请先读一下“在自己的服务器上的部署步骤”这一节。
由于 Heroku 的限制,当 30 分钟内没有请求的话就会被冻结,之后再次启动时数据就丢了,因此这里我们采用配置环境变量的方式进行配置。

### 手动部署
1. Fork 本项目。
2.[此处](https://dashboard.heroku.com/new-app)新建一个 Heroku APP,名字随意,之后可以设置自己的域名。
3. 在 Deployment method 处,选择 Connect to Github,输入 message-pusher 搜索本项目,之后点击 Connect,之后启用自动部署(Enable Automatic Deploys)。
Expand All @@ -64,6 +64,9 @@
|SMTP_PASS|smtp 服务器用户凭据|
|HREF|服务的 href,如 https://wechat-message.herokuapp.com/ ,注意后面要有 /|

### 一键部署
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/Ecalose/message-pusher)

## 发送消息的方式
1. 发送纯文本消息:直接 HTTP GET 请求 `https://你的域名/前缀/消息`,缺点是有字数限制,且只能是纯文本,这是微信模板消息的限制。
2. 发送 Markdown 消息,调用方式分为两种:
Expand Down
60 changes: 60 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"name": "message-pusher",
"description": "消息推送服务",
"env": {
"MODE": {
"description": "Heroku 模式",
"value": "1"
},
"WECHAT_APP_ID": {
"description": "你的测试号的 APP ID",
"value": ""
},
"WECHAT_APP_SECRET": {
"description": "你的测试号的 APP Secret",
"value": ""
},
"WECHAT_TEMPLATE_ID": {
"description": "你的测试号的模板消息的 ID",
"value": ""
},
"WECHAT_OPEN_ID": {
"description": "你的 Open ID",
"value": ""
},
"WECHAT_VERIFY_TOKEN": {
"description": "你自己设置的验证 token",
"value": ""
},
"EMAIL": {
"description": "你的默认目标邮箱",
"value": ""
},
"PREFIX": {
"description": "你的前缀,如 admin",
"value": ""
},
"SMTP_SERVER": {
"description": "smtp 服务器地址,如 smtp.qq.com",
"value": ""
},
"SMTP_USER": {
"description": "smtp 服务器用户邮箱",
"value": ""
},
"SMTP_PASS": {
"description": "你自己设置的验证 token",
"value": ""
},
"WECHAT_VERIFY_TOKEN": {
"description": "smtp 服务器用户凭据",
"value": ""
},
"HREF": {
"description": "服务的 href,如 https://wechat-message.herokuapp.com/ ,注意后面要有 /",
"value": ""
}
},
"website": "https://github.com/Ecalose/message-pusher",
"repository": "https://github.com/Ecalose/message-pusher"
}

0 comments on commit f3b6b74

Please sign in to comment.