Skip to content

Latest commit

 

History

History
89 lines (65 loc) · 1.82 KB

CHANGELOG.md

File metadata and controls

89 lines (65 loc) · 1.82 KB

Changelog

4.x

4.0.x

4.0.0

  • Add meta-router/macro
  • BREAKING CHANGE: Drop support for Node.js < 8

3.x

3.0.x

3.0.0

  • The options passed to path-to-regexp must now provided via the matchOptions property of a route configuration as shown below:
[

    {
        "route": "GET /users/:user => ./user",
        "security": {
            "authenticationRequired": true,
            "redirect": true
        },
        "matchOptions": {
            "sensitive": false,
            "strict": false,
            "end": true
        }
    },
    ...
]

Supported properties for matchOptions:

  • sensitive When true the route will be case sensitive. (default: false)
  • strict When false the trailing slash is optional. (default: false)
  • end When false the path will match at the beginning. (default: true)

Previously, the match options could be provided via top-level caseSensitive, strict and end properties. Those properties are no longer supported.

2.x

2.1.x

2.1.0

  • Fixes #7 - Allow route metadata to be attached to route handler function:
function userHandler(req, res, next) {
    // ...
}

userHandler.routeMeta = {
    security: {
        authenticationRequired: true,
        redirect: true
    }
}

// You can also optionally attach middleware to the route:
userHandler.routeMiddleware = [
    function (req, res, next) {
        // ...
    },
    // ...
]

module.exports = userHandler;
  • Introduced new shorthand syntax for declaring routes in JSON:
[

    "GET /users/:user => ./user",
    "GET /login => ./user#login",
    "GET /logout => ./user#logout",
    "POST /users/:user/picture => ./user#uploadPicture"
]