Skip to content

Commit

Permalink
fix: express
Browse files Browse the repository at this point in the history
  • Loading branch information
njzjz committed Feb 10, 2019
1 parent 8275fe8 commit 4e04caa
Show file tree
Hide file tree
Showing 3 changed files with 358 additions and 3 deletions.
10 changes: 7 additions & 3 deletions index.js
@@ -1,12 +1,16 @@
var chemicaltoolsbot = require('chemicaltoolsbot')
var chemicaltoolsbot = require('./chemicaltoolsbot')
var wechat = require('wechat');
var express = require('express')
var app = express()
var config = {
token: 'zengjinzhe',
appid: 'wx0cd8b5047421a3aa',
encodingAESKey: 'HQGUNPgz1fogojffKg0KDl6eW5UMEsdlhwGo0CdFWQj',
checkSignature: false
};
app.use(express.query());
app.use('/wechat', wechat(config).text(function (message, req, res, next) {
res.reply(chemicaltoolsbot.reply(message))
app.use('/wechat', wechat(config, function (req, res, next) {
var message = req.weixin;
res.reply(chemicaltoolsbot.reply(message.Content))
}))
app.listen(3000)

0 comments on commit 4e04caa

Please sign in to comment.