<commit_before>
// - - - - - - - - - - - - - - - - - - - - - - - - >>>>> vars

// var ssStylus, ractiveOptions = {};
var http = require('http');
var ss = require('socketstream');
var ssJade = require('ss-jade');

var config = require('./server/services/config');
// console.log(config.get('port'));
// var dbService = require('./server/services/db');

// - - - - - - - - - - - - - - - - - - - - - - - - >>>>> db services

// dbService.connectMongoose();
// dbService.connectRedis();

// - - - - - - - - - - - - - - - - - - - - - - - - >>>>> ROUTES

// require('./server/services/routes')(ss);

// // Define a single-page client called 'main'
// ss.client.define('main', {
// 	view: 'app.jade',
// 	css: ['app.styl'],
// 	code: ['libs/jquery.min.js', 'app'],
// 	tmpl: '*'
// });

// // Serve this client on the root URL
// ss.http.route('/', function(req, res) {
// 	res.serveClient('main');
// });

// Code Formatters
ss.client.formatters.add(require('ss-jade'));
ss.client.formatters.add(require('ss-stylus'));

// Use server-side compiled Hogan (Mustache) templates. Others engines available
// ss.client.templateEngine.use(require('ss-hogan'));

// Minimize and pack assets if you type: SS_ENV=production node app.js
if (ss.env === 'production') {
	ss.client.packAssets();
}

// Start web server
var server = http.Server(ss.http.middleware);
server.listen(config.get('port'));

// Start SocketStream
ss.start(server);
<commit_msg>improvement on app.js<commit_after>
// - - - - - - - - - - - - - - - - - - - - - - - - >>>>> vars

var http = require('http');
var ss = require('socketstream');
var ssJade = require('ss-jade');
var ssStylus = require('ss-stylus');

var config = require('./server/services/config');
// var dbService = require('./server/services/db');

// - - - - - - - - - - - - - - - - - - - - - - - - >>>>> db services

// dbService.connectMongoose();
// dbService.connectRedis();

// - - - - - - - - - - - - - - - - - - - - - - - - >>>>> ROUTES

// require('./server/services/routes')(ss);

// // Define a single-page client called 'main'
// ss.client.define('main', {
// 	view: 'app.jade',
// 	css: ['app.styl'],
// 	code: ['libs/jquery.min.js', 'app'],
// 	tmpl: '*'
// });

// // Serve this client on the root URL
// ss.http.route('/', function(req, res) {
// 	res.serveClient('main');
// });


// - - - - - - - - - - - - - - - - - - - - - - - - >>>>> HTML FORMATTER

// if (ss.env === 'development') {
// 	ssJade.addCompileOptions({
// 		pretty: true
// 	});
// }
ss.client.formatters.add(ssJade, {
	locals: {
		// title: 'Arx :: Home',
		// mobileAgents: JSON.stringify(require(rootDir + '/data/mobile-agents')),
		// SubAtomic: JSON.stringify(SubAtomic.getGlobals()),
		// mobile: false
	},
});

// - - - - - - - - - - - - - - - - - - - - - - - - >>>>> STYLE FORMATTER


// ssStylus.prependStylus(
// 	'$cloudPath = \'' + cloudPath + '/\'\n' +
// 	'$cache = \'' + SubAtomic.get('CACHE') + '\''
// );
ss.client.formatters.add(ssStylus);

// - - - - - - - - - - - - - - - - - - - - - - - - >>>>> TEMPLATE ENGINE

ss.client.templateEngine.use(require('ss-ractive'), '/', {
	pretty: ss.env === 'production' ? false : true
});

// - - - - - - - - - - - - - - - - - - - - - - - - >>>>> PACK ASSETS

// Minimize and pack assets if you type: SS_ENV=production node app.js
if (ss.env === 'production') {
	ss.client.packAssets();
}

// start web server
var server = http.Server(ss.http.middleware);
server.listen(config.get('port'));

// start socketstream
ss.start(server);

{'fraction_non_alphanumeric': 0.2669722142652535, 'fraction_numerical': 0.0, 'mean_word_length': 2.0551181102362204, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 53, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 30, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3184121', 'n_tokens_mistral': 1326, 'n_tokens_neox': 1301, 'n_words': 208}