//usage: node app.js [html file] [private key file] [certificate file]

var bcrypt = require('bcrypt');
var https = require('https');
var fs = require('fs');
var auth = require('http-auth');

var basic = auth.basic({realm: ""},
  function (username, password, callback) {
    bcrypt.compare(password, fs.readFileSync('htpasswd',{encoding:'utf8'}),
      function(err, res) {
        callback(res);
    });
  }
);

var options = {
  key: fs.readFileSync(process.argv[3]), //argv[3] = [private key file]
  cert: fs.readFileSync(process.argv[4]) //argv[4] = [certificate file]
};

// Starting server.
https.createServer(basic, options, function (req, res) {
    res.end(fs.readFileSync(process.argv[2])); //argv[2] = [html file]
}).listen(443);

// Log URL.
console.log("Server running at https://127.0.0.1:443/");

@@ -571,16 +571,18 @@
 le%5D%0A%7D;%0A%0A
+%0A%0A
 // Start
@@ -652,16 +652,401 @@
 es) %7B%0A  
+//log request%0A  var now = new Date();%0A  var jsonDate = now.toJSON();%0A  var ip = req.headers%5B'x-forwarded-for'%5D %7C%7C%0A     req.connection.remoteAddress %7C%7C%0A     req.socket.remoteAddress %7C%7C%0A     req.connection.socket.remoteAddress;%0A  console.log(jsonDate + %22: request from: %22 + ip);%0A  console.log(%22                          user: %22 + req.user);%0A%0A  //actually serve file%0A  res.writeHead(200)%0A
   res.en
@@ -1130,30 +1130,105 @@
 %0A// 
-Log URL.%0Aconsole.log(%22
+log server starting%0Avar now = new Date();%0Avar jsonDate = now.toJSON();%0Aconsole.log(jsonDate + %22: 
 Serv

Improve logging for app.js