title: Nodejs Express basicAuth custom login page
body: <p>I am currently using node.js express to create a webserver.  I am using the following for authentication:</p>
  
  <pre><code>app.use(express.basicAuth(function(user, pass) {
    return user === XXX &amp;&amp; pass === YYY;
  }));
  </code></pre>
  
  <p>but when the user is not logged in it simply opens a basic popup for the users credentials.  How can I modify this to allow me to create custom loginpage the user gets routed to and then sends the login credentials back?</p>