<commit_before>#!/usr/bin/env node
'use strict';

var express = require('express');
var rest = require('rest-sugar');
var sugar = require('object-sugar');
var taskist = require('taskist');

var config = require('./config');
var schemas = require('./schemas');
var tasks = require('./tasks');


main();


function main() {
    taskist(config.tasks, tasks, {
        instant: function(err) {
            if(err) {
                return console.error(err);
            }

            serve();
        }
    });
}

function serve() {
    var app = express();
    var port = config.port;

    app.configure(function() {
        app.set('port', port);

        app.use(express.logger('dev'));

        app.use(app.router);
    });

    app.configure('development', function() {
        app.use(express.errorHandler());
    });



    var api = rest(app, '/api/v1', {
        geeks: schemas.Geek
    }, sugar);

    api.pre(function() {
        api.use(rest.only('GET'));
    });
    process.on('exit', terminator);

    ['SIGHUP', 'SIGINT', 'SIGQUIT', 'SIGILL', 'SIGTRAP', 'SIGABRT', 'SIGBUS',
    'SIGFPE', 'SIGUSR1', 'SIGSEGV', 'SIGUSR2', 'SIGPIPE', 'SIGTERM'<commit_msg>Allow remote access to content<commit_after>#!/usr/bin/env node
'use strict';

var express = require('express');
var rest = require('rest-sugar');
var sugar = require('object-sugar');
var taskist = require('taskist');

var config = require('./config');
var schemas = require('./schemas');
var tasks = require('./tasks');


main();


function main() {
    taskist(config.tasks, tasks, {
        instant: function(err) {
            if(err) {
                return console.error(err);
            }

            serve();
        }
    });
}

function serve() {
    var app = express();
    var port = config.port;

    app.configure(function() {
        app.set('port', port);

        app.use(express.logger('dev'));

        app.use(app.router);
    });

    app.configure('development', function() {
        app.use(express.errorHandler());
    });

    app.all('*', function(req, res, next) {
        res.header('Access-Control-Allow-Origin', '*');
        res.header('Access-Control-Allow-Headers', 'X-Requested-With');

        next();
    });

    var api = rest(app, '/api/v1', {
        geeks: schemas.Geek
    }, sugar);

    api.pre(function() {
        api.use(rest.only('GET'));
    });
    process.on('exit', terminator);

    ['SIGHUP', 'SIGINT', 'SIGQUIT', 'SIGILL', 'SIGTRAP', 'SIGABRT', 'SIGBUS',
    'SIGFPE', 'SIGUSR1', 'SIGSEGV', 'SIGUSR2', 'SIGPIPE', 'SIGTERM'
{'fraction_non_alphanumeric': 0.19537073362102786, 'fraction_numerical': 0.0023538642604943117, 'mean_word_length': 2.596614950634697, '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': '6751766', 'n_tokens_mistral': 852, 'n_tokens_neox': 816, 'n_words': 163}