Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Really basic basic authentication middleware
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
examples
README.md
index.js
package.json
test.js

README.md

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);
});

License

MIT

Something went wrong with that request. Please try again.