expresso-router
v1.0.2
Published
A faster, safer, backwards compatible router alternative for Express.
Downloads
5
Maintainers
Readme
expresso-router
A faster, safer, backwards compatible router alternative for Express.
const express = require('express');
const expresso = require('expresso-router');
const router = expresso();
router.get('/', function (req, res) {
res.send('Hello World');
});
app.use(router);
app.listen(3000);
Installation
npm install expresso-router
Features
Speed
- significantly faster than the default Express original router, especially for static and parameterized routes
Compatibility
- highly compatible with Express APIs. A drop-in replacement in many cases.
- also compatible with Node's built in http server.
Safety
- Prevents common sources of error by default by throwing easy-to-understand exceptions when creating invalid or overlapping routes
- Disallows suboptimal choices, such as regular expression routes, unless explicitly allowed
- Order independent. The order you add routes shouldn't matter. Expresso will match by specificity.
Documentation and migration information.
More detailed API documentation