2.1.1 • Published 7 years ago

express-versioned-routes v2.1.1

Weekly downloads
40
License
MIT
Repository
github
Last release
7 years ago

Express Versioned Routes

Greenkeeper badge

Build Status Coverage Status

This middleware allows express routes to be mounted by version and provides a method to route between version paths and accept headers. The latter is based on the assumption that a version property will exist on the request object. See express-request-version as a means for doing this.

This middleware will mount paths from a directory that match the supported versions you specify. Each mounted directory's index.js should return either a router or valid middleware. For example, if the middleware is used with the base path routes and supported versions v1, v2, then the routers from routes/v1/index.js and routes/v2/index.js would be mounted.

Usage

var versionRoutes = require('express-versioned-routes');

app.use('/', versionRoutes(
  path.join(__dirname, 'routes'),
  ['v1', 'v1.1', 'v2']
));
2.1.1

7 years ago

2.1.0

7 years ago

2.0.0

7 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.0

9 years ago