A hook is just a callback function that gets executed whenever a piece of data passes by the dispatcher in the course of a data flow. Multiple hooks can be tied to a single flow. Each hook can be set to run when the message object comes in (input hook) or when the response goes out (output hook).
Hooks must extend the base Hook class.
The handler can generate and return a response. Hooks can run on the response as well on the data.
process()
.path (string) - Returns the path of the hook file.
get path() {
return __filename;
}
const hook = require('iris-hook-myAwesomeHook');
hook.on('data', function(event){
console.log('data', event.data);
});
Every event
object contains the following properties: