我通过这个链接(https://docs.feathersjs.com/real-time/primus.html)通过feathersjs primus创建了一个websocket服务器。下面是我使用的app.configure代码:
app.configure(primus({
transformer: 'websocket'
}, function(primus) {
// Do something with primus
primus.use('todos::create', function(socket, done){
// Exposing a request property to services and hooks
socket.request.feathers.referrer = socket.request.referrer;
done();
});
}));当运行这段代码时,我得到了以下错误:
node_modules/primus/index.js:697
throw new PrimusError('The plugin is missing a client or server function', this);
^我所做的一切都是按照上面的链接进行的。为什么我会收到这条错误消息?我还错过了什么?
https://stackoverflow.com/questions/41276976
复制相似问题