Router Event Resource
A fork to dpd-event-callback to create events that run before target events are run.
It works with a router middleware to ensure this happens.
$ npm install dpd-router-event dpd-router-middleware --save
The following methods have been provided to indicate intent:
skip: Only available the
ON BEFOREREQUESTevent and indicates that the method event should be skipped and the actual resource request event should be executed.
proceed: Available on all events except the
ON BEFOREREQUESTand indicates that the actual resource request event should be run. It takes not parameters.
kill: Terminates the routing and sends a response. Parameters are error and response.
killIf: Calls the kill method if the logic is true. Parameters are logic, error and response.
setResult has been removed to mark a major difference between router events and normal events.
Apart from the apis provided by
resource has also been added and holds the actual resource requested.