0.0.3 • Published 11 years ago

connect-requirements v0.0.3

Weekly downloads
15
License
-
Repository
-
Last release
11 years ago

connect-requirements

Require specific keys in request.

Usage

var http = require('http')
var connect = require('connect')
var requirements = require('connect-requirements')

var app = connect()

// make sure the objects are added to the request before the request is checked for requirements
    .use(connect.query())
    .use(connect.bodyParser())


// you can specify any objects within the request to check for keys
    .use(requirements({ query: 'foo' }))
    .use(requirements({ body: ['bar', 'foobar'] }))

    .use(function(req, res){
        res.end('hello world\n');
    })

http.createServer(app).listen(3000);
0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago