<commit_before>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("private-key.pem"),
  cert: fs.readFileSync("certificate.pem")
};

// Starting server.
https.createServer(basic, options, function (req, res) {
    res.end(fs.readFileSync("portable.html"));
}).listen(443);

// Log URL.
console.log("Server running at https://127.0.0.1:443/");<commit_msg>Update app.js to take filenames from command line<commit_after>//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) {
}).listen(443);
    res.end(fs.readFileSync(process.argv[2])); //argv[2] = [html file]

// Log URL.
console.log("Server running at https://127.0.0.1:443/");
{'fraction_non_alphanumeric': 0.19377835385612444, 'fraction_numerical': 0.020738820479585224, 'mean_word_length': 4.553956834532374, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6102603', 'n_tokens_mistral': 538, 'n_tokens_neox': 524, 'n_words': 116}