node-priority
priority resources dispatcher for nodejs
Usage
var resource = { if x === 'ping' return 'pong'; else return thisnext; } { return y; }; resource;resource;
node-priority
supports timeout, the default value is 30
seconds, and you can define your timer
before .fetch()
:
resource; // set timeout to 100ms
You also can define new timer to get timeout
event:
resource;
For convience, it supports set back to default timeout by:
resource; // set back to default timeout
Implement an XML/JSON HTTP router(but priority with JSON response)
// define your resourcervar resourcer = { var self = this; if reqaccept === 'application/json' ; else selfnext; } { ; }; // define routerapp;
Installation
$ npm install priority --save
License
MIT