humble-flash
Flash message plugin for humble-session and hapi.
Installation
npm i --save humble-flash
Usage
Note. This module requires humble-session to be registered as well.
TODO: write usage example
API ### reply.flash(type, message, cb)
Adds a new flash message of a specified type to the session.
Arguments
type
- String - The type of the flash message.
message
- String - The text of the message.
cb(err)
- Function - A function that is called once the flash message was saved
to the session.
Creates a pre-handler that fetches the messages of the specified type from the session and removes them from it.
Arguments
type
- String - The type of the messages to return.
Usage
var humbleFlash = ; // ...server;
License
MIT