1.0.1 • Published 7 years ago
hemera-parambulator v1.0.1
Hemera-parambulator package
This is a plugin to use Parambulator with Hemera.
We prefer to use Joi as a payload validator. The status quo of payload validation in NodeJs.
Example
const Hemera = require('./../')
const nats = require('nats').connect()
const hemera = new Hemera(nats, {
logLevel: 'info'
})
hemera.use(require('hemera-parambulator'))
hemera.ready(() => {
// Use Parambulator as payload validator
hemera.setOption('payloadValidator', 'hemera-parambulator')
/**
* Your Implementations
*/
hemera.add({
topic: 'math',
cmd: 'add',
a: {
type$: 'number'
}
}, (req, cb) => {
cb(null, req.a + req.b)
})
hemera.act({
topic: 'math',
cmd: 'add',
a: 'dwed3',
b: 20
}, function (err, resp) {
this.log.info('Error', err)
})
})
Pass the full schema
hemera.add({
topic: 'email',
cmd: 'send',
pb$: {
a: {
type$: 'number'
}
}
}, (resp, cb) => {
})
1.0.1
7 years ago
1.0.0
7 years ago
0.2.2
7 years ago
0.2.1
7 years ago
0.2.0
7 years ago
0.1.92
8 years ago
0.1.91
8 years ago
0.1.90
8 years ago
0.1.89
8 years ago
0.1.88
8 years ago
0.1.87
8 years ago
0.1.86
8 years ago
0.1.85
8 years ago
0.1.84
8 years ago
0.1.83
8 years ago
0.1.82
8 years ago
0.1.81
8 years ago
0.1.80
8 years ago
0.1.79
8 years ago
0.1.78
8 years ago
0.1.77
8 years ago
0.1.76
8 years ago
0.1.75
8 years ago
0.1.74
8 years ago
0.1.73
8 years ago
0.1.72
8 years ago
0.1.71
8 years ago
0.1.70
8 years ago
0.1.69
8 years ago
0.1.68
8 years ago
0.1.67
8 years ago
0.1.66
8 years ago
0.1.65
8 years ago
0.1.64
8 years ago
0.1.63
8 years ago
0.1.62
8 years ago
0.1.61
8 years ago
0.1.60
8 years ago
0.1.59
8 years ago
0.1.58
8 years ago