1.2.5 • Published 9 years ago

version-control v1.2.5

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

version-control

Build Status

A nodejs middleware for client version controlling

It forces a custom header to be sent from the client in order to allow a call to pass through this middleware

header must be sent in the form of:

x-app-version : [PLATFORM]/[VERSION_NUMBER]

How to use

install middleware

npm install --save version-control

sample code

var restify = require('restify');
var server = restify.createServer({
        name: 'test-server'
    });

var versionCheck = require('version-control')();
server.use(versionCheck);
server.listen(3000, function(){
    console.log('listening on port 3000');
});

Settings

you can also provide custom settings

var options = {
    "header" : "x-app-version",
    "platforms" : {
        "all" : {
            "link": "http://test.link",
            "1.0" : true
        }
    },
    "public" : [],
    "installPath" : "/install",
    "versionPath" : "/version",
    "errorStatusCode" : 400
 }

var versionCheck = require('version-control')(options);
  • header: header that is required to be included
  • platforms: object that allows you to setup valid platforms and valid versions
  • public: array of string with public paths that must to be ignored by version-control (use * as a wildcard)
  • installPath: (default empty) base path that tells version-control to redirect to the latest install link for platform (e.g. an installPath of "/install" makes a call to "/install/all" point to "http://test.link" with the example settings)
  • versionPath: (default "/version") base path that allows a client to check if its version is allowed
  • errorStatusCode: (default "400") status code returned for invalid version codes
1.2.5

9 years ago

1.2.4

10 years ago

1.2.3

10 years ago

1.2.2

10 years ago

1.2.1

10 years ago

1.2.0

10 years ago

1.1.8

10 years ago

1.1.7

10 years ago

1.1.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago