roota
Promise based routing
Last updated a year ago by npmfish .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install roota 
SYNC missed versions from official npm registry.

roota

npm version Build Status

roota is a simple promise-based routing framework, influenced heavily by express.

const r = new Router();

r.use("/big/pot/:potNumber", req => {
    return `Big Pot ${req.params.potNumber}`;
});

r.use("/small/cup/:cupNumber", req => {
    return `Small Cup ${req.params.cupNumber}`;
});

r.handleRequest({ path: "/big/pot/1" }).then(value => {
    console.log(`-- Value ${value}`);
}).then(() => {
    return r.handleRequest({ path: "/small/cup/9" }).then(value => {
        console.log(`-- Value: ${value}`);
    });
});

Current Tags

  • 1.7.0                                ...           latest (a year ago)

13 Versions

  • 1.7.0                                ...           a year ago
  • 1.6.0                                ...           a year ago
  • 1.5.0                                ...           a year ago
  • 1.4.0                                ...           a year ago
  • 1.3.0                                ...           a year ago
  • 1.2.0                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.5                                ...           2 years ago
  • 1.0.4                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 13
This Month 13
Last Day 0
Last Week 0
Last Month 14
Dependencies (3)
Dev Dependencies (5)
Dependents (2)

Copyright 2014 - 2016 © taobao.org |