Skip to content

Files

Latest commit

0cd5040 · Feb 19, 2016

History

History
43 lines (27 loc) · 619 Bytes

README.md

File metadata and controls

43 lines (27 loc) · 619 Bytes

Deprecated

Use the mounting feature in express instead http://expressjs.com/en/4x/api.html#app.onmount

api version ====

Wrapper for express routing methods to help with versioning apis

##Usage

>var apiv = require('api-version');
>var app = express();

>var api = apiv.version(app, '/api', 'v1');
>var api2 = apiv.version(app, '/api', 'v2');

>api.get('/user', function(){

>});

>api.post('/user', function(){

>});

>api2.get('/user', function(){

>});
>```

>Since the routes were added using api instead of app, the routes turn out to be

>```
/api/v1/user

and

/api/v2/user