An open API service indexing awesome lists of open source software.

https://github.com/puse/decanat-router

Client-side router.
https://github.com/puse/decanat-router

Last synced: over 1 year ago
JSON representation

Client-side router.

Awesome Lists containing this project

README

          

# ![Router](http://decanat.github.io/router/images/vane-s.png) decanat-router

Client-side router.

## Installation

Using [component](https://github.com/component/component):

$ component install decanat/router

Using [npm](http://npmjs.org/) for [browserify](http://browserify.org/):

$ npm install decanat-router

## Usage

```js
var Router = require('router');

var router = Router();

router.route('/blog/:thread/')
.use(function(ctx, next){
console.log(ctx.params.thread); // thread id parsed from url
next()
});

router.listen();
```

## Test

Run unit tests:

$ make test

## Forebears

-
-

## License

The MIT License.