Socket
Socket
Sign inDemoInstall

api-version

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    api-version

Wrapper for express routing methods to help with versioning apis


Version published
Weekly downloads
10
decreased by-23.08%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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

FAQs

Last updated on 15 Dec 2013

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc