Skip to content

Latest commit

 

History

History
35 lines (22 loc) · 1.12 KB

.verb.md

File metadata and controls

35 lines (22 loc) · 1.12 KB

How it works

en-route is a different, but similar concept to routes you might be familiar with, like express routes. The general idea is, you can:

  1. Use middleware to modify file objects
  2. Define routes, to determine whether or not a middleware function should run on a given file.
  3. 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.

Usage

const Router = require('en-route');
const router = new Router();

API

{%= apidocs("lib/router.js") %} {%= apidocs("lib/route.js") %} {%= apidocs("lib/layer.js") %}

Release history

v2.0.0

Breaking changes

  • en-route was completely refactored from the ground-up.

v1.0.0

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.