<commit_before>/*:tabSize=2:indentSize=2:noTabs=true:mode=javascript:*/

var _ = require('underscore'),
    express = require('express'), 
    Options = require('./atom-dataset-provider/options'),
    scanner = require('./atom-dataset-provider/directory-scanner'),
    templater = require('./atom-dataset-provider/templater');
    
var options = (new Options).parse(process.argv);

var app = express.createServer();

app.configure(function() {
    app.use(express.logger());
    app.use(express.errorHandler({dumpExceptions: true, showStack: true}));
    app.use(app.router);
    app.use(express.static(options.directory));
});

app.get('/', function(req, res) {
    _.defaults(req.query, { limit: 10 });
    res.header('Content-Type', 'application/xml');
    scanner.scan(options.directory, req.query, function(err, scanResult) {
        var feedData = _.defaults(scanResult, {
          id: 'http://'+require('os').hostname()+':'+options.port+'/',
          title: options.title
        });
        templater.render(feedData, function(err, data) {
            res.send(data);
        });<commit_msg>Added default favicon.<commit_after>/*:tabSize=2:indentSize=2:noTabs=true:mode=javascript:*/

var _ = require('underscore'),
    express = require('express'), 
    Options = require('./atom-dataset-provider/options'),
    scanner = require('./atom-dataset-provider/directory-scanner'),
    templater = require('./atom-dataset-provider/templater');
    
var options = (new Options).parse(process.argv);

var app = express.createServer();

app.configure(function() {
    app.use(express.logger());
    app.use(express.errorHandler({dumpExceptions: true, showStack: true}));
    app.use(app.router);
    app.use(express.favicon());
    app.use(express.static(options.directory));
});

app.get('/', function(req, res) {
    _.defaults(req.query, { limit: 10 });
    res.header('Content-Type', 'application/xml');
    scanner.scan(options.directory, req.query, function(err, scanResult) {
        var feedData = _.defaults(scanResult, {
          id: 'http://'+require('os').hostname()+':'+options.port+'/',
          title: options.title
        });
        templater.render(feedData, function(err, data) {
            res.send(data);
        });
{'fraction_non_alphanumeric': 0.1854658938921088, 'fraction_numerical': 0.0035666518056174765, 'mean_word_length': 3.6652806652806653, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '3684808', 'n_tokens_mistral': 688, 'n_tokens_neox': 684, 'n_words': 101}