This package has been deprecated

Author message:

this package is no longer maintained.

tinyrouter

0.2.7 • Public • Published

tinyrouter

A tiny router base implementation

NPM Version NPM Downloads NPM Downloads NPM Downloads

Install

$ npm install tinyrouter --save

Usage

var tinyrouter = require('tinyrouter');
 
var router = tinyrouter()
  .use(function(req, res, next) {
    next();
  })
  .get('/path', function(req, res, next) {
    console.log('path', req.parentURL, req.url, req.currentURL);
    next(new Error('error'));
  })
  .on('error', function(e) {
    console.error(e.detail.error);
  });
  
var req = {
  url: '/path'
};
var res = {};
router(req, res, function(err) {
   console.log('finished');
});

License

Licensed under the MIT License. See LICENSE for the full license text.

Readme

Keywords

Package Sidebar

Install

npm i tinyrouter

Weekly Downloads

2

Version

0.2.7

License

MIT

Unpacked Size

20.3 kB

Total Files

5

Last publish

Collaborators

  • admin.attrs
  • aquarela53
  • joje