en-route is a different, but similar concept to routes you might be familiar with, like express routes. The general idea is, you can:
- Use middleware to modify file objects
- Define routes, to determine whether or not a middleware function should run on a given file.
- Define handlers for running specific middleware at specific points in your application or build.
See the examples folder for a number of different examples of how en-route works.
const Router = require('en-route');
const router = new Router();
{%= apidocs("lib/router.js") %} {%= apidocs("lib/route.js") %} {%= apidocs("lib/layer.js") %}
Breaking changes
- en-route was completely refactored from the ground-up.
Breaking changes
- en-route no longer supports error middleware (middleware with three arguments). This was done to simplify debugging, eliminate code debt that makes en-route harder to maintain and improve, to make en-route and middleware run faster, and to make certain that errors are always passed to the final done function.