<commit_before>var http = require('http')
	,util = require('util')
	,fs = require('fs')
	,path = require('path')
	,_ = require('underscore')
	,util = require('util')
	,url = require('url')
	,static = require('node-static')
	,events = require('events');
	
exports.server = function(paths, options) {
	var me = this;
	
	// call events constructor
	events.EventEmitter.call(me);

	// initialize options and apply defaults
	me.paths = paths || {};
	me.options = options || {};
	me.options.host = me.options.host || '0.0.0.0';
	me.options.port = me.options.port || 1337;
	me.options.staticDir = me.options.staticDir || '/emergence/kernel-www';
	
	// initialize state
}
util.inherits(exports.server, events.EventEmitter);


exports.server.prototype.start = function() {
	var me = this;

	// create static fileserver
	me.fileServer = new static.Server(me.options.staticDir);
	
	// start control server
	http.createServer(function(request, response) {
		request.content = '';
	
		request.addListener('data', function(chunk) {
			request.content += chunk;
		});
	
		request.addListener('end', function() {
			request.urlInfo = url.parse(request.url)
			request.path = request.urlInfo.pathname.substr(1).split('/');
			console.log(request.method+' '+JSON.stringify(request.urlInfo));
			
			if(me.paths.hasOwnProperty(request.path[0]))<commit_msg>fixed path to kernel-www for running as NPM module<commit_after>var http = require('http')
	,util = require('util')
	,fs = require('fs')
	,path = require('path')
	,_ = require('underscore')
	,util = require('util')
	,url = require('url')
	,static = require('node-static')
	,events = require('events');
	
exports.server = function(paths, options) {
	var me = this;
	
	// call events constructor
	events.EventEmitter.call(me);

	// initialize options and apply defaults
	me.paths = paths || {};
	me.options = options || {};
	me.options.host = me.options.host || '0.0.0.0';
	me.options.port = me.options.port || 1337;
	me.options.staticDir = me.options.staticDir || __dirname+'/../kernel-www';
	
	// initialize state
}
util.inherits(exports.server, events.EventEmitter);


exports.server.prototype.start = function() {
	var me = this;

	// create static fileserver
	me.fileServer = new static.Server(me.options.staticDir);
	
	// start control server
	http.createServer(function(request, response) {
		request.content = '';
	
		request.addListener('data', function(chunk) {
			request.content += chunk;
		});
	
		request.addListener('end', function() {
			request.urlInfo = url.parse(request.url)
			request.path = request.urlInfo.pathname.substr(1).split('/');
			console.log(request.method+' '+JSON.stringify(request.urlInfo));
			
			if(me.paths.hasOwnProperty(request.path[0]))
{'fraction_non_alphanumeric': 0.1709653647752395, 'fraction_numerical': 0.007369196757553427, 'mean_word_length': 4.221153846153846, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 3, 'xml': 0}, 'pii_count': 2, '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': '617533', 'n_tokens_mistral': 932, 'n_tokens_neox': 868, 'n_words': 167}