title: Simple password authentication for express app
body: <p>I've spent a long time now trying to find a simple way to password-protect a site built with Express (4) but I've been unable to find a tutorial or module which would help. What there seems to be out there are either complicated, <a href="https://scotch.io/tutorials/javascript/easy-node-authentication-setup-and-local" rel="nofollow">full-blown user registration/login procedures</a> using <a href="http://passportjs.org/" rel="nofollow">passport</a>, or too simple and insecure HTTP basic authentication (<a href="http://troywhiteley.com/12/http-basic-auth-for-nodejs/" rel="nofollow">like this one</a>) without any kind of session support (and lots of variations on the above themes).</p>
  
  <p>All I'm looking for is something which would redirect the index page to a login page, unless logged in, with some kind of log out option with session support. I don't need a database and I'd be happy to hard code user-password combos, as long as they are relatively secure.</p>
  
  <p>Are there any kind of resources out there that would help with this?</p>
  
  <p>Any help or pointers would be greatly appreciated.</p>