Skip to content

Instantly share code, notes, and snippets.

@tmartineau
Created August 25, 2012 19:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmartineau/3470172 to your computer and use it in GitHub Desktop.
Save tmartineau/3470172 to your computer and use it in GitHub Desktop.
Stripped down example of using HTTP Authentication in Express
var express = require('express'),
httpAuth = express.basicAuth('user', 'pass');
var app = module.exports = express.createServer();
app.configure(function(){
...
app.use(httpAuth);
...
});
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment