Current collected state Current
Observed since 20 Oct, 19:43 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
3h-router
A simple router.
A simple router lib.
const Router = require('3h-router'),
router = new Router({ basePath: __dirname });
// You can get default values via Router.defaultOptions.
router.defaultPages.unshift('my-default-page.html');
router.subRouters.unshift('my-sub-router.js');
router.on('before', url => {
console.log(`[before] ${url}`);
// If there's any `before` event handler, then
// the routing will pause here, so remember to
// call router.route to continue the routing.
// In addition, if you want to forward the
// request, then just pass the target url.
router.route(url);
}).on('result', result => {
console.log(`[result] ${result.code}`);
}).on('error', err => {
console.log('An error occurred!');
console.error(err);
}).start(88);
console.log('Server started on port 88!');
module.exports = router => {
const { response } = router;
response.writeHead(200, {
'Content-Type': 'text/html'
});
response.end('<h1>Generated by sub-router!</h1>');
};
Just read the declaration files in typings to learn the APIs.
Download counts and popularity will appear here as the collector receives them.
Declarations describe requirements; they are not a resolved dependency graph.
Source distribution
{
"integrity": "sha512-eNzTKo+3Mzvb5vmgLt2ji7cPi9pjNG8G9Bv2mjXCfyy0mvqrJN6YFtqDc+BKn1GJtD+47x24a3GERIePrMTvZw==",
"shasum": "d4d570a23598bb44f39e552eb19e7e12898567a2",
"tarball": "https://registry.npmjs.org/3h-router/-/3h-router-1.7.0.tgz",
"fileCount": 9,
"unpackedSize": 17063,
"signatures": [
{
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
"sig": "MEUCIBl4G0mSEuQ2UCRLvawGWEYHHB2Z6IX2OJ1UZ8g3okoHAiEAujkOMSXEOJCFYaYm7oik83tdvQVFIETyeReVIL9a8HU="
}
]
}Observed since 20 Oct, 19:43 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:ef6fa52216756ddda15c38aee341096ab879a6006b26232bc3769e012c8e2ed8