<commit_before># Paperboy

## Purpose

A node.js module for delivering static files.

## Features
  
 * Configurable callbacks on most events
 * ETag / 304 Support
 * Custom HTTP headers

## Example

Example from example/basic.js:

    var
      sys = require('sys'),
      path = require('path'),
      http = require('http'),
      paperboy = require('../lib/paperboy'),

      PORT = 8003,
      WEBROOT = path.join(path.dirname(__filename), 'webroot');

    http.createServer(function(req, res) {
      var ip = req.connection.remoteAddress;
      paperboy
        .deliver(WEBROOT, req, res)
        .addHeader('Expires', 300)
        .addHeader('X-PaperRoute', 'Node')
        .before(function() {
          sys.log('Recieved Request')
        })
        .after(function(statCode) {
          res.write('Delivered: '+req.url);
          log(statCode, req.url, ip);
        })
        .error(function(statCode,msg) {
          res.writeHead(statCode, {'Content-Type': 'text/plain'});
          res.write("Error: " + statCode);
          res.close();
          log(statCode, req.url, ip, msg);
        })
        .otherwise(function(err) {
          var statCode = 404;
          res.writeHead(statCode, {'Content-Type': 'text/plain'});<commit_msg>Fix typo in README.<commit_after># Paperboy

## Purpose

A node.js module for delivering static files.

## Features
  
 * Configurable callbacks on most events
 * ETag / 304 Support
 * Custom HTTP headers

## Example

Example from example/basic.js:

    var
      sys = require('sys'),
      path = require('path'),
      http = require('http'),
      paperboy = require('../lib/paperboy'),

      PORT = 8003,
      WEBROOT = path.join(path.dirname(__filename), 'webroot');

    http.createServer(function(req, res) {
      var ip = req.connection.remoteAddress;
      paperboy
        .deliver(WEBROOT, req, res)
        .addHeader('Expires', 300)
        .addHeader('X-PaperRoute', 'Node')
        .before(function() {
          sys.log('Received Request')
        })
        .after(function(statCode) {
          res.write('Delivered: '+req.url);
          log(statCode, req.url, ip);
        })
        .error(function(statCode,msg) {
          res.writeHead(statCode, {'Content-Type': 'text/plain'});
          res.write("Error: " + statCode);
          res.close();
          log(statCode, req.url, ip, msg);
        })
        .otherwise(function(err) {
          var statCode = 404;
          res.writeHead(statCode, {'Content-Type': 'text/plain'});
{'fraction_non_alphanumeric': 0.14860557768924304, 'fraction_numerical': 0.010358565737051793, 'mean_word_length': 2.290956749672346, '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': '3969178', 'n_tokens_mistral': 798, 'n_tokens_neox': 761, 'n_words': 162}