Basic auth in node.js
Posted on August 21, 2012 | Categories: Technology
Super easy – already supported if you use express/connect.
Example (using express):
var express = require('express');
function authorize(username, password) {
return 'username' === username & 'password' === password;
}
var app = express.createServer(
express.basicAuth(authorize)
);
September 5th, 2012 at 11:18 am
[...] I’ve been doing development with node.js and since Heroku supports it (wonder if they were first to offer it), it was a [...]