<commit_before>var express = require('express');
var childProcess = require('child_process');
var middleware = require('./config/initializers/middleware.js');
var router = require('./config/routes.js');
var host = process.env.HOST;
var port = process.env.PORT || 4000;
var app = express();
var sequelize = require('./config/initializers/sequelize.js');
var nconf = require('./config/nconf.js');
var fs = require('fs');
var https = require('https');

middleware.configure(app);
router.route(app);

var sslOptions = {
  key: fs.readFileSync('./certs/server.key'),
  cert: fs.readFileSync('./certs/server.crt')
};

sequelize.sync().success(function(){
  if (host) {
    https.createServer(sslOptions, app).listen(port, host);
  } else {
    https.createServer(sslOptions, app).listen(port);
  }

  var incomingPaymentsMonitor = childProcess.spawn("node", ["workers/listener.js"]);

  incomingPaymentsMonitor.stdout.on('data', function(data){
    console.log(data.toString());
  });

  incomingPaymentsMonitor.stderr.on('data', function(data){  
    console.log(data.toString());
  });

  setTimeout(function(){
    var outgoingPaymentsMonitor = childProcess.spawn("node", ["workers/outgoing_ripple_payments.js"]);
    outgoingPaymentsMonitor.stdout.on('data', function(data) {
      console.log(data.toString());
    });

    outgoingPaymentsMonitor.stderr.on('data', function(data) {
      console.log(data.toString());
    });
  },10000);

  console.log('Serving HTTP on', (host || 'localhost')+":"+port);
})

<commit_msg>[FEATURE] Add option to turn off SSL in node.js.<commit_after>var express = require('express');
var childProcess = require('child_process');
var middleware = require('./config/initializers/middleware.js');
var router = require('./config/routes.js');
var host = process.env.HOST;
var port = process.env.PORT || 4000;
var app = express();
var sequelize = require('./config/initializers/sequelize.js');
var nconf = require('./config/nconf.js');
var fs = require('fs');
var https = require('https');

middleware.configure(app);
router.route(app);

var sslOptions = {
  key: fs.readFileSync('./certs/server.key'),
  cert: fs.readFileSync('./certs/server.crt')
};

sequelize.sync().success(function(){
  var ssl = nconf.get('SSL');
  if (ssl == 'false') { ssl = false }
  if (host && ssl) {
    https.createServer(sslOptions, app).listen(port, host);
  } else if (ssl) {
    https.createServer(sslOptions, app).listen(port);
  } else if (host) {
    app.listen(port, host);
  } else {
    app.listen(port);
  }
  
  var incomingPaymentsMonitor = childProcess.spawn("node", ["workers/listener.js"]);

  incomingPaymentsMonitor.stdout.on('data', function(data){
    console.log(data.toString());
  });

  incomingPaymentsMonitor.stderr.on('data', function(data){  
    console.log(data.toString());
  });

  setTimeout(function(){
    var outgoingPaymentsMonitor = childProcess.spawn("node", ["workers/outgoing_ripple_payments.js"]);
    outgoingPaymentsMonitor.stdout.on('data', function(data) {
      console.log(data.toString());
    });

    outgoingPaymentsMonitor.stderr.on('data', function(data) {
      console.log(data.toString());
    });
  },10000);

  console.log('Serving '+ (ssl ? 'HTTPS' : 'HTTP') +' on', (host || 'localhost')+":"+port);
})


{'fraction_non_alphanumeric': 0.18618159584225008, 'fraction_numerical': 0.005502904310608377, 'mean_word_length': 4.660899653979238, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '4907171', 'n_tokens_mistral': 1069, 'n_tokens_neox': 1041, 'n_words': 184}