Last active
August 29, 2015 14:07
-
-
Save lsongdev/a4462c8ba2830489dafa to your computer and use it in GitHub Desktop.
demo case for simsimi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var express = require('express'); | |
| var xmlParser = require('express-xml'); | |
| var wechat = require('wechat-lite'); | |
| var Simsimi = require('simsimi'); | |
| var app = express(); | |
| var simsimi = new Simsimi({ | |
| lc : 'zh', | |
| key: '7f503329-9755-49dc-95d3-c586cf578914' | |
| }); | |
| app.use(xmlParser); | |
| app.use('/wechat', wechat('token', function(req, res){ | |
| simsimi.listen(req.msg.Content, function(err, response){ | |
| res.reply(response || req.msg.Content); | |
| }); | |
| })); | |
| app.listen(7777); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment