0
任何人都有經驗與塞內卡?Seneca-mesh CL MISSING
我有問題,當我嘗試inclue目...
這是高致病性禽流感路線:
server.route({
method: 'GET',
path: '/api/ping',
handler: function (req, reply) {
server.seneca// load the mesh plugin
.use('mesh')
// send a message out into the network
// the network will know where to send format:hex messages
.act('foo:1,v:2', (err: any, out: any) => {
console.log(err)
// prints #FF0000
reply(null, out)
})
}
})
這是我的服務:
require('seneca')({
})
//.use('zipkin-tracer', {sampling:1})
.use('entity')
.use('ping-logic')
.ready(function(){
console.log(this.id)
})
邏輯:
module.exports = function post(options) {
var seneca = this
seneca// provide an action for the format:hex pattern
.add('foo:1', function (msg, done) {
done(null, {x:1,v:100+msg.v})
})
.use('mesh', { auto:true, pin:'foo:1' })
}
我得到錯誤
CL MISSING {富:1,V:2}
人知道什麼是porblem?
FYI一個更新版本的seneca-mesh插件(v0.11.0)現在是npm上的最新版本,與seneca v3.4.1協同工作=>不需要使用master分支。 – Adam