Skip to content

pqx/cxx-router

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cxx-router Build Status

Lightweight router module for node and browser

Installation

npm install cxx-router --save

Usage

var Router = require('cxx-router');
var router = new Router();
function article() {}

router.on('article', '/article/:article', article);
router.match('/article/hello-world?page=1');

// name: 'article'
// params: {article: 'hello-world'}
// path: '/article/hello-world'
// fns: [article]
// qs: 'page=1'

var href = router.href('article', {article: 'hello-world'}, 'page=1');
// href: '/article/hello-world?page=1'

Supported browsers

IE9+

Releases

No releases published

Packages

No packages published