I\'ve created a simple little route parsing function so that I can keep my code clean and easily maintainable, this is the little function that gets ran when the app starts
I have the same problem, so i verified that node_modules/socket.io/lib/socket.js was received
Socket.prototype.onevent = function(packet){
var args = packet.data || [];
debug('emitting event %j', args);
if (null != packet.id) {
debug('attaching ack callback to event');
args.push(this.ack(packet.id));
}
emit.apply(this, args);
};
so i changed to:
Socket.prototype.onevent = function(packet){
var args = packet.data || [];
debug('emitting event %j', args);
if (null != packet.id) {
debug('attaching ack callback to event');
args.push(this.ack(packet.id));
}
emit.apply(this, [args]);
};
it's solve to me
Fixed it by changing:
eval.apply(this, 'p1', 'p2')
to:
eval.apply(this, ['p1', 'p2'])
You need to send the params as an array, like this:
app[method.toLowerCase()].apply(this, [path, fn]);
If you want to send an arguments list you need to use call:
app[method.toLowerCase()].call(this, path, fn);
Source: call, apply