Skip to content

Instantly share code, notes, and snippets.

@Lewuathe
Created March 10, 2013 07:26
Show Gist options
  • Select an option

  • Save Lewuathe/5127496 to your computer and use it in GitHub Desktop.

Select an option

Save Lewuathe/5127496 to your computer and use it in GitHub Desktop.
Basic authentication with express ref: http://qiita.com/items/f6e539cfe9cd19822017
var auth = express.basicAuth(function(user,pass){
return user === myuser && pass === mypasswd;
});
app.get("/admin", auth, function(req, res){
res.render("admin", { title : "This is admin" });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment