restify-url-version

Get restify version from url querystring

Restify URL Version

Extract version from URL for restify routing

With npm

npm install restify-url-version
var restify = require('restify')
  , restifyURLVersion = require('restify-url-version')
  , server = restify.createServer()
 
server.pre(restifyURLVersion('v', 'version', 'x-api-version'))
  • paramName - string or array of param names to extract from querystring
  • headerName - restify accepted version header (optional, default x-api-version)
restifyURLVersion('_v')
restifyURLVersion('_v', 'accept-version')
restifyURLVersion(['_v', 'v', 'version'], 'x-api-version')

License