<commit_before>var mod_connect       		= require('connect')
	, mod_sys         		= require('sys')
    , mod_path        		= require('path')
	, mod_resourceservice   = require('./resourceservice.js')
	, mod_resourcemanager   = require('./resourcemanager.js')
	, mod_tagmanager		= require('./tagmanager.js')
	, mod_cache				= require('./Cache.js')
	, mod_socketio			= require('./socketio.js')	
    , mod_modules    		= require('./modules.js')
    , mod_fs          		= require('fs')
    , cache 				= null
    , logger				= require('./logger.js').getLogger('Server')
    , mod_renderer			= require('./renderer2.js')

if (process.argv.length < 3) {
	logger.error('usage: ...');
	process.exit();
}

// [TBD] handle arguments properly
// [TBD] dynamic config service 
var config = null;
logger.info('reading config from ' + process.argv[2]); 
mod_fs.readFile(process.argv[2], function (err, data) {
	if (err) {
		logger.error('error reading configuration');
		process.exit();
	}
	config = JSON.parse(data);
	logger.info('config loaded');
	mod_cache.configure(config);
	mod_resourceservice.configure(config);	
	mod_resourcemanager.configure(config, mod_cache);
	mod_tagmanager.setTagList(config.taglib);
	mod_modules.configure(config, mod_tagmanager);

	console.time('render'); 
	var r = new mod_renderer.Renderer(mod_tagmanager);
	r.render('file:///Users/cag/workspace/rain/modules/app/htdocs/index.html').then(function () {
		console.timeEnd('render');
		setTimeout(function (){process.exit();},10);
	});
});<commit_msg>do not use local paths -_-<commit_after>var mod_connect       		= require('connect')
	, mod_sys         		= require('sys')
    , mod_path        		= require('path')
	, mod_resourceservice   = require('./resourceservice.js')
	, mod_resourcemanager   = require('./resourcemanager.js')
	, mod_tagmanager		= require('./tagmanager.js')
	, mod_cache				= require('./Cache.js')
	, mod_socketio			= require('./socketio.js')	
    , mod_modules    		= require('./modules.js')
    , mod_fs          		= require('fs')
    , cache 				= null
    , logger				= require('./logger.js').getLogger('Server')
    , mod_renderer			= require('./renderer2.js')

if (process.argv.length < 3) {
	logger.error('usage: ...');
	process.exit();
}

// [TBD] handle arguments properly
// [TBD] dynamic config service 
var config = null;
logger.info('reading config from ' + process.argv[2]); 
mod_fs.readFile(process.argv[2], function (err, data) {
	if (err) {
		logger.error('error reading configuration');
		process.exit();
	}
	config = JSON.parse(data);
	logger.info('config loaded');
	mod_cache.configure(config);
	mod_resourceservice.configure(config);	
	mod_resourcemanager.configure(config, mod_cache);
	mod_tagmanager.setTagList(config.taglib);
	mod_modules.configure(config, mod_tagmanager);

	console.time('render'); 
	var r = new mod_renderer.Renderer(mod_tagmanager);
	r.render('file://' + mod_path.join(__dirname, '..', '/modules/app/htdocs/index.html')).then(function () {
		console.timeEnd('render');
		setTimeout(function (){process.exit();},10);
	});
});
{'fraction_non_alphanumeric': 0.17402682368334968, 'fraction_numerical': 0.003925417075564278, 'mean_word_length': 3.861685214626391, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1266887', 'n_tokens_mistral': 1045, 'n_tokens_neox': 1016, 'n_words': 161}