我尝试使用 Express.io 转发路线,但它不起作用,我阅读了 Github 上的文档,我完全按照他们说的做了。不知道问题出在哪里...
app.post('/signin', function(req, res) {
me.pseudo = req.body.pseudo;
me.email = req.body.email;
me.gravatar = "http://www.gravatar.com/avatar/" + md5(me.email) + "?s=140";
users.push(me);
req.io.route('hello'); //error here
});
app.io.route('hello', function(req) {
console.log('Done !');
});
错误:
TypeError: Cannot call method 'route' of undefined
at /Users/anthonycluse/Sites/Tchat-Express/app.js:78:12