express-eventify
Converts an express app instance into an object which can subscribe to REST requests like events.
Installation
# Install via NPM npm install express-eventify# OR # Install via Yarn yarn add express-eventify
Usage
express-eventify
extends an express app by introducing the $on
function.
Initialize
const express = ;const eventify = ; // create a new express applet app = ;// initialize the new express appapp = ;
Subscribe
There are two ways of subscribing to express with express-eventify
// notice the '!' - it seperates the REST method and the path i.e. "{method}!{path}"// in this case it's 'get' and '/'app;
The second way discribes shows how the $on
function consumes an object as a parameter.
app;
Notes
The following express methods are wrapped by express-eventify
:
- delete
- get
- param
- post
- put
- render
License
Donating
Please support this project via gratipay.