title: NodeJS Method not allowed
body: <pre><code>module.exports.login = function (request, response, next) {
  if (request.body.user &amp;&amp; request.body.password) {
      response.end('submitted');
  } else {
      common.render('login', function (error, file) {
          if (error) {
              next(error);
          } else {
              response.writeHead(200, 'OK', { 'Content-Type': 'text/html' });
              var stream = fs.createReadStream(file);
              stream.pipe(response);
          }
      });
  }
  };
  </code></pre>
  
  <p>I am using <code>connect</code> with <code>body-parser</code>. When I first time open this app I see login form - nice, but when I submit a form I see in a console 405 Method not allowed error. I was trying to add some headers but it didn't work. Anyone can help?</p>