<commit_before>/**
 * tty.js
 * Copyright (c) 2012, <NAME> (MIT License)
 */

process.title = 'tty.js';

/**
 * Modules
 */

var path = require('path')
  , fs = require('fs')
  , EventEmitter = require('events').EventEmitter;

var express = require('express')
  , io = require('socket.io')
  , pty = require('pty.js');

/**
 * Config
 */

var conf = require('./config');

/**
 * Auth
 */

var auth = basicAuth();

/**
 * App & Middleware
 */

var app = conf.https && conf.https.key && !conf.https.disabled
  ? express.createServer(conf.https)
  : express.createServer();

app.use(function(req, res, next) {
  var setHeader = res.setHeader;
  res.setHeader = function(name) {
    switch (name) {
      case 'Cache-Control':
      case 'Last-Modified':
      case 'ETag':
        return;
    }
    return setHeader.apply(res, arguments);
  };
  next();
});

app.use(auth);

app.use(express.favicon(__dirname + '/../static/favicon.ico'));

app.use(app.router);

if (conf.static) {
  app.use(express.static(conf.static));
}

app.use(express.static(__dirname + '/../static'));

/**
 * Stylesheets
 */

app.get('/style.css', function(req, res, next) {
  res.contentType('.css');
  res.sendfile(conf.stylesheet);
});

app.get('/user.css', function(req, res, next) {<commit_msg>move custom static middleware to top of stack<commit_after>/**
 * tty.js
 * Copyright (c) 2012, <NAME> (MIT License)
 */

process.title = 'tty.js';

/**
 * Modules
 */

var path = require('path')
  , fs = require('fs')
  , EventEmitter = require('events').EventEmitter;

var express = require('express')
  , io = require('socket.io')
  , pty = require('pty.js');

/**
 * Config
 */

var conf = require('./config');

/**
 * Auth
 */

var auth = basicAuth();

/**
 * App & Middleware
 */

var app = conf.https && conf.https.key && !conf.https.disabled
  ? express.createServer(conf.https)
  : express.createServer();

app.use(function(req, res, next) {
  var setHeader = res.setHeader;
  res.setHeader = function(name) {
    switch (name) {
      case 'Cache-Control':
      case 'Last-Modified':
      case 'ETag':
        return;
    }
    return setHeader.apply(res, arguments);
  };
  next();
});

app.use(auth);

if (conf.static) {
  app.use(express.static(conf.static));
}

app.use(express.favicon(__dirname + '/../static/favicon.ico'));

app.use(app.router);

app.use(express.static(__dirname + '/../static'));

/**
 * Stylesheets
 */

app.get('/style.css', function(req, res, next) {
  res.contentType('.css');
  res.sendfile(conf.stylesheet);
});

app.get('/user.css', function(req, res, next) {
{'fraction_non_alphanumeric': 0.20373250388802489, 'fraction_numerical': 0.003110419906687403, 'mean_word_length': 3.302675585284281, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6734204', 'n_tokens_mistral': 917, 'n_tokens_neox': 908, 'n_words': 173}