0.1.1 • Published 12 years ago

tinyauth v0.1.1

Weekly downloads
10
License
-
Repository
github
Last release
12 years ago

node-tinyauth

Really basic basic authentication middleware

Example

var http = require('http')
  , handler = require('tinyauth')({
      realm: 'My secret server',
      accounts: ['foo:1234']
    })
  , port = 3000
  ;

http.createServer(function(req, res) {
  handler(req, res, function() {
    res.writeHead(200, {'Content-Type': 'text/plain'});
    res.write('welcome!');
    res.end();
  });
}).listen(port, function() {
  console.log('test server running on port ' + port);
});
0.1.1

12 years ago

0.1.0

12 years ago

0.0.0

12 years ago