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);
npm install expresso-router
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.