It looks like implementing basic HTTP authentication with Express v3 was trivial:
app.use(express.basicAuth(\'username\', \'password\'));
V
I used the code for the original basicAuth to find the answer:
app.use(function(req, res, next) {
var user = auth(req);
if (user === undefined || user['name'] !== 'username' || user['pass'] !== 'password') {
res.statusCode = 401;
res.setHeader('WWW-Authenticate', 'Basic realm="MyRealmName"');
res.end('Unauthorized');
} else {
next();
}
});