<commit_before>#!/usr/bin/env node

var http = require('http');
var util = require('util');
var routing = require('./routing');
var staticServer = require('./staticServer');
var searchApi = require('./search');

function apiExample(req, res) {
    res.writeHead(200, {'Content-Type': 'text/plain'});
    res.end('Api\n' + req.url + '\n');
}

routing.addRoute('^/app/', 'GET', staticServer.handleRequest);
routing.addRoute('^/api/', 'GET', searchApi.handleRequest);


var DEFAULT_PORT = 8000;

function main(argv) {
  var port = DEFAULT_PORT;
  if (argv[2]) {
    port = Number(argv[2]);<commit_msg>Support /app without a trailing slash<commit_after>#!/usr/bin/env node

var http = require('http');
var util = require('util');
var routing = require('./routing');
var staticServer = require('./staticServer');
var searchApi = require('./search');

function apiExample(req, res) {
    res.writeHead(200, {'Content-Type': 'text/plain'});
    res.end('Api\n' + req.url + '\n');
}

routing.addRoute('^/app/|^/app$', 'GET', staticServer.handleRequest);
routing.addRoute('^/api/', 'GET', searchApi.handleRequest);


var DEFAULT_PORT = 8000;

function main(argv) {
  var port = DEFAULT_PORT;
  if (argv[2]) {
    port = Number(argv[2]);
{'fraction_non_alphanumeric': 0.20293398533007334, 'fraction_numerical': 0.014669926650366748, 'mean_word_length': 4.738317757009346, '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': '1751152', 'n_tokens_mistral': 424, 'n_tokens_neox': 406, 'n_words': 92}