code: function redirect() {
                  var resultURL = urlTransform(req.url, function(parsed) {
                      parsed.pathname += '/';
                      return parsed;
                  });
  
                  res.statusCode = 301;
                  res.setHeader('Location', resultURL);
                  res.end('Redirecting to ' + resultURL);
              }
docs: Redirect to directory's index.html