boa-router
TypeScript icon, indicating that this package has built-in type declarations

0.4.0 • Public • Published

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)

/boa-router/

    Package Sidebar

    Install

    npm i boa-router

    Weekly Downloads

    2

    Version

    0.4.0

    License

    MIT

    Last publish

    Collaborators

    • bouzuya