title: Node.js http basic auth
body: <p>Is it possible to do basic auth in Node.js just like in Apache?</p>
  
  <p><a href="http://doc.norang.ca/apache-basic-auth.html">http://doc.norang.ca/apache-basic-auth.html</a></p>
  
  <p>I know that if using Express or Connect I can add  middle-ware functionality and do user verification, but I'm trying to restrict the whole area (I don't need to authenticate users from a database just a couple of defined users) - I'm using Ubuntu.</p>
  
  <p><a href="https://github.com/kaero/node-http-digest">https://github.com/kaero/node-http-digest</a></p>
  
  <p>That's something I can do, but I'm not sure if "exposing" or directly writing the user and password in the code is secure enough.</p>
  
  <p>Many thanks.</p>