<commit_before>require('./utils/consoleLog.js');
require('./utils/extend.js');
require('./utils/arrayTrim.js');
require('./utils/stringUpperCase.js');
require('./utils/objectIsEmpty.js');
var nodeNative = {};
nodeNative['http'] = require('http');
var externalLibs = {};
externalLibs['ws'] = require('ws');
var server = require('./Router.js');
var wsRouter = require('./WSRouter.js');
process.die = function(message){
    console.log(message);
    process.exit();
}
/**
 *
 * @param portNumber
 * @param pathToApplication
 * @param sslCfg SSL Configs must have key and cert anything else is ignored.s
 * @returns {boolean}
 */
exports.start = function (portNumber, pathToApplication, options) {
    if (typeof(portNumber) != "number") {
        return false;
    }
    if (typeof pathToApplication == 'undefined' || isEmpty(pathToApplication)) {
        console.log("invalid path to application:", pathToApplication);
        return false;
    }
    if (typeof options['mongo'] == 'undefined'){
        console.log('running without mongodb means no sessions');
    }
    var httpServer;
    if (typeof options['sslCfg'] == "undefined" || typeof options.sslCfg['key'] == "undefined" || typeof options.sslCfg['cert'] == "undefined") {
        httpServer = nodeNative.http.createServer(server.HTTPServerFunction(pathToApplication, options));
    } else {
        httpServer = nodeNative.http.createServer({key: sslCfg.key, cert: sslCfg.cert}, server.HTTPServerFunction(pathToApplication, options));
    }
    pathToApp = pathToApplication;
    httpServer.listen(portNumber, "127.0.0.1");
    console.log('Server running at http://127.0.0.1:' + portNumber + '/');
}

exports.Controller = require("./Controller.js");
//exports.Websocket = require('./Websocket.js');
exports.Mapper = require("./Mapper.js");
exports.Model = require("./Model.js"); // for now there's not much functionality in models<commit_msg>linting issues and set index to bind on 0.0.0.0<commit_after>'use strict';

require('./utils/consoleLog.js');
require('./utils/extend.js');
require('./utils/arrayTrim.js');
require('./utils/stringUpperCase.js');
require('./utils/objectIsEmpty.js');
var nodeNative = {
    http: require('http')
};
var externalLibs = {
    ws: require('ws')
};
var server = require('./Router.js');
var wsRouter = require('./WSRouter.js');
process.die = function(message){
    console.log(message);
    process.exit();
};
/**
 *
 * @param portNumber
 * @param pathToApplication
 * @param sslCfg SSL Configs must have key and cert anything else is ignored.s
 * @returns {boolean}
 */
exports.start = function (portNumber, pathToApplication, options) {
    if (typeof(portNumber) != "number") {
        return false;
    }
    if (typeof pathToApplication === 'undefined' || isEmpty(pathToApplication)) {
        console.log("invalid path to application:", pathToApplication);
        return false;
    }
    if (typeof options.mongo === 'undefined'){
        console.log('running without mongodb means no sessions');
    }
    var httpServer;
    if (typeof options.sslCfg === "undefined" || typeof options.sslCfg.key === "undefined" || typeof options.sslCfg.cert === "undefined") {
        httpServer = nodeNative.http.createServer(server.HTTPServerFunction(pathToApplication, options));
    } else {
        httpServer = nodeNative.http.createServer({key: options.sslCfg.key, cert: options.sslCfg.cert}, server.HTTPServerFunction(pathToApplication, options));
    }
    var pathToApp = pathToApplication;
    httpServer.listen(portNumber, "0.0.0.0");
    console.log('Server running at http://127.0.0.1:' + portNumber + '/');
};

exports.Controller = require("./Controller.js");
//exports.Websocket = require('./Websocket.js');
exports.Mapper = require("./Mapper.js");
exports.Model = require("./Model.js"); // for now there's not much functionality in models
{'fraction_non_alphanumeric': 0.16623309053069718, 'fraction_numerical': 0.006763787721123829, 'mean_word_length': 4.113031914893617, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 5, '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': '2662616', 'n_tokens_mistral': 1115, 'n_tokens_neox': 1108, 'n_words': 254}