<commit_before>/*!
* SourceJS - Living Style Guides Engine and Integrated Maintenance Environment for Front-end Components
* @copyright 2013-2015 Sourcejs.com
* @license MIT license: http://github.com/sourcejs/source/wiki/MIT-License
* */

var express = require('express');
var colors = require('colors');
var fs = require('fs');
var loadOptions = require('./core/loadOptions');
var commander = require('commander');
var bodyParser = require('body-parser');
var favicon = require('serve-favicon');

/* Globals */
global.app = express();
global.opts = loadOptions();

// Arguments parse */
commander
    .option('-l, --log [string]', 'Log level (default: ' + global.opts.core.common.defaultLogLevel + ')',  global.opts.core.common.defaultLogLevel)
    .option('-p, --port [number]', 'Server port (default: ' + global.opts.core.common.port + ')', global.opts.core.common.port)
    .option('--html', 'Turn on HTML parser on app start')
    .parse(process.argv);

global.commander = commander;

global.app.set('views', __dirname + '/core/views');
global.app.set('user', __dirname + '/' + global.opts.core.common.pathToUser);

// We support `development` (default), `production` and `presentation` (for demos)
global.MODE = process.env.NODE_ENV || 'development';

global.pathToApp = __dirname.replace(/^\w:\\/, function (match) {
    return match.toLowerCase();
});

// Default logger
var logger = require('./core/logger');
var log = logger.log;
global.log = log;

if (commander.html) global.opts.core.parseHTML.onStart = true;
if (commander.port) global.opts.core.common.port = parseInt(commander.port);
/* /Globals */


/* App config */

// Optimization
global.app.use(require('compression')());

// Cookies
global.app.use(require('cookie-parser')());
global.app.use(require('express-session')({
    secret: (function() {<commit_msg>commenting latest windows paths fix<commit_after>/*!
* SourceJS - Living Style Guides Engine and Integrated Maintenance Environment for Front-end Components
* @copyright 2013-2015 Sourcejs.com
* @license MIT license: http://github.com/sourcejs/source/wiki/MIT-License
* */

var express = require('express');
var colors = require('colors');
var fs = require('fs');
var loadOptions = require('./core/loadOptions');
var commander = require('commander');
var bodyParser = require('body-parser');
var favicon = require('serve-favicon');

/* Globals */
global.app = express();
global.opts = loadOptions();

// Arguments parse */
commander
    .option('-l, --log [string]', 'Log level (default: ' + global.opts.core.common.defaultLogLevel + ')',  global.opts.core.common.defaultLogLevel)
    .option('-p, --port [number]', 'Server port (default: ' + global.opts.core.common.port + ')', global.opts.core.common.port)
    .option('--html', 'Turn on HTML parser on app start')
    .parse(process.argv);

global.commander = commander;

global.app.set('views', __dirname + '/core/views');
global.app.set('user', __dirname + '/' + global.opts.core.common.pathToUser);

// We support `development` (default), `production` and `presentation` (for demos)
global.MODE = process.env.NODE_ENV || 'development';

// Define absolute path to app, normalizing windows disk name
global.pathToApp = __dirname.replace(/^\w:\\/, function (match) {
    return match.toLowerCase();
});

// Default logger
var logger = require('./core/logger');
var log = logger.log;
global.log = log;

if (commander.html) global.opts.core.parseHTML.onStart = true;
if (commander.port) global.opts.core.common.port = parseInt(commander.port);
/* /Globals */


/* App config */

// Optimization
global.app.use(require('compression')());

// Cookies
global.app.use(require('cookie-parser')());
global.app.use(require('express-session')({
    secret: (function() {
{'fraction_non_alphanumeric': 0.17922008547008547, 'fraction_numerical': 0.004273504273504274, 'mean_word_length': 4.515463917525773, 'pattern_counts': {'":': 0, '<': 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': '2377737', 'n_tokens_mistral': 1169, 'n_tokens_neox': 1146, 'n_words': 269}