boa-router
v0.4.0
Published
A router library for b-o-a
Downloads
7
Readme
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