node package manager

boa-router

boa-router

A routing library for b-o-a.

Installation

$ npm install boa-router

Usage

import { init } from 'boa-router';
const routes = [
  { path: '/users' },
  { path: '/users/:id' }
];
const router = init(routes);
const matched = router('/users/123');
// { route: { path: '/users/:id' }, params: { id: '123' } }
 
const notMatched = router('/items');
// null

Badges

Circle CI

License

MIT

Author

bouzuya <m@bouzuya.net> (http://bouzuya.net)