<commit_before>//////////////////////////////////////////////////////////////////////////////
var os      = require("os"),
    path    = require("path"),

    // External deps
    express = require("express"),
    _       = require("underscore")._,

    // Setup app instance
    app = express(),

    // Grab app settings
    SETTINGS = require("./config.json");


//////////////////////////////////////////////////////////////////////////////
// Fix up some settings like the url etc, also
// default params for required vars
SETTINGS.url  = "http://" + os.hostname();
SETTINGS.port = SETTINGS.port || 1234;


//////////////////////////////////////////////////////////////////////////////
// Configure the express app
app.set("view engine", "ejs");
app.set("views", path.join(__dirname, "templates"));
app.set("trust proxy", true);

// Point _ to the app locals so we can refer to it from
// the ejs templates
app.locals._ = _;


//////////////////////////////////////////////////////////////////////////////
// Define application routes
var middleware = require("./app/middleware.js")(SETTINGS);
var handlers   = require("./app/route_handlers.js")(SETTINGS);
require("./app/routes.js")(app, middleware, handlers);


//////////////////////////////////////////////////////////////////////////////
// Start server
console.log("\nServer up at " + SETTINGS.url + ":" + SETTINGS.port);
app.listen(SETTINGS.port);<commit_msg>add validation of project paths, this is useful when we move stuff and forget about the sink<commit_after>//////////////////////////////////////////////////////////////////////////////
var os      = require("os"),
    path    = require("path"),
    fs      = require("fs"),

    // External deps
    express = require("express"),
    _       = require("underscore")._,

    // Setup app instance
    app = express(),

    // Grab app settings
    SETTINGS = require("./config.json");


//////////////////////////////////////////////////////////////////////////////
// Fix up some settings like the url etc, also
// default params for required vars
SETTINGS.url  = "http://" + os.hostname();
SETTINGS.port = SETTINGS.port || 1234;


//////////////////////////////////////////////////////////////////////////////
// Configure the express app
app.set("view engine", "ejs");
app.set("views", path.join(__dirname, "templates"));
app.set("trust proxy", true);

// Point _ to the app locals so we can refer to it from
// the ejs templates
app.locals._ = _;


//////////////////////////////////////////////////////////////////////////////
// Define application routes
var middleware = require("./app/middleware.js")(SETTINGS);
var handlers   = require("./app/route_handlers.js")(SETTINGS);
require("./app/routes.js")(app, middleware, handlers);


//////////////////////////////////////////////////////////////////////////////
// Start server
console.log("\nServer up at " + SETTINGS.url + ":" + SETTINGS.port);
app.listen(SETTINGS.port);


//////////////////////////////////////////////////////////////////////////////
// Validate that all the projects have a folder representing them
_.each(SETTINGS.projects, function(project) {
    fs.exists(project.path, function(exists) {
        if (!exists) {
            console.log("Warning, path: " + project.path + " does not exist (project: " + project.name + ").");
        }
    });
});
{'fraction_non_alphanumeric': 0.37466387809979085, 'fraction_numerical': 0.0023902001792650133, 'mean_word_length': 1.3041982105987613, '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': '4682109', 'n_tokens_mistral': 795, 'n_tokens_neox': 778, 'n_words': 221}