0.2.7 • Published 6 years ago

tinyrouter v0.2.7

Weekly downloads
15
License
MIT
Repository
github
Last release
6 years ago

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.

0.2.7

6 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.2

8 years ago

0.0.1

8 years ago

0.0.0

8 years ago