restify-url-version
v0.0.3
Published
Get restify version from url querystring
Downloads
4
Readme
Restify URL Version
Extract version from URL for restify routing
Install
With npm
npm install restify-url-version
Usage
var restify = require('restify')
, restifyURLVersion = require('restify-url-version')
, server = restify.createServer()
server.pre(restifyURLVersion('v', 'version', 'x-api-version'))
restifyURLVersion(paramName, [headerName])
paramName
- string or array of param names to extract from querystringheaderName
- restify accepted version header (optional, defaultx-api-version
)
restifyURLVersion('_v')
restifyURLVersion('_v', 'accept-version')
restifyURLVersion(['_v', 'v', 'version'], 'x-api-version')