@flexshopper/hapi-listeners

1.0.1 • Public • Published

@flexshopper/hapi-listeners NPM version Build Status

Documentation

Getting started

How use it

  • Install hapi-listeners npm package in your project our plugin. npm i @flexshopper/hapi-listeners

Registering

manifest style:

registrations: [
    ...
    {
        plugin: {
            register: '@flexshopper/hapi-listeners',
            options: {
                dirname: '/lib/listeners'
            }
        }
    }
];

Listener structure:

module.exports = {
    name: 'eventName',
    method: (data) => {
        // any code that will execute when eventName is fired
    }
};

Just by creating a kraken event in any route handler

server.route({
    method: 'GET',
    path: '/route',
    handler: (request, reply) => {

        request.krakenEvent = {
            name: 'eventName',
            data: {}
        };
    }
})

Guidelines

License

© Flexshopper, LLC

/@flexshopper/hapi-listeners/

    Package Sidebar

    Install

    npm i @flexshopper/hapi-listeners

    Weekly Downloads

    2

    Version

    1.0.1

    License

    none

    Last publish

    Collaborators

    • mohanadsheikha
    • daniel.garavito
    • mcarballosa
    • fs-lstanley
    • danishkazmi
    • travis-fs