微信订阅号基本配置 - ouruixi
微信订阅号基本配置
申请
自己登陆微信公众平台申请,步骤略
配置ngrok
网址:
http://www.ittun.com/
步骤
-
解压后打开config.yml
server_addr: “ittun.com:36415” //不用改
trust_host_root_certs: false
inspect_addr: 127.0.0.1:8891
tunnels:
ssh:
remote_port: 51001
proto:
tcp: “:22”
web:
subdomain: ouruixi //二级域名
proto:
http: “:8088” //这里是node监听的端口号 -
配置startup.bat
@echo on
cd %cd%
#ngrok -proto=tcp 22
ngrok start web
#ngrok -subdomain test1 8080
ngrok 80 -
双击startup.bat即可
用node配置服务器
要返回echostr给微信验证
\'use strict\'
const express = require(\'express\')
const app = express()
app.all(\'/wxserver\', (req, res) => {
let echostr = req.query.echostr
res.send(echostr)
})
app.listen(8088, \'127.0.0.1\', (err) => {
if (err) {
console.log(\'服务器开启异常\')
} else {
console.log(\'服务器开启成功,端口:8088\')
}
})
微信公众平台
步骤
- 打开开发里的基本配置
- 开启开发者密码
- 服务器配置-修改配置
- 把刚才ngrok的二级域名填上去,其他配置自己填
- 点击提交,校验成功