<commit_before>var url = require('url');
var fs = require('fs');
var path = require('path');
var powerfs = require('powerfs');
var _ = require('underscore');

_.mixin(require('underscore.string').exports());

exports.serveConstructor = function(dependencies) {
  return function(rootpath, settings) {
    settings = settings || {};

    if (_.isUndefined(settings.assetRoot)) {
      settings.assetRoot = rootpath;
    }

    return function(req, res, next) {
      var pathname = url.parse(req.url).pathname;
      var filepath = path.join(rootpath, pathname);

      if (!fs.existsSync(filepath)) {
        next();
        return;<commit_msg>Avoid error messages in "serve" if file does not exist<commit_after>var url = require('url');
var fs = require('fs');
var path = require('path');
var powerfs = require('powerfs');
var _ = require('underscore');

_.mixin(require('underscore.string').exports());

exports.serveConstructor = function(dependencies) {
  return function(rootpath, settings) {
    settings = settings || {};

    if (_.isUndefined(settings.assetRoot)) {
      settings.assetRoot = rootpath;
    }

    return function(req, res, next) {
      var pathname = url.parse(req.url).pathname;
      var filepath = path.join(rootpath, pathname);

      var existsSync = fs.existsSync || path.existsSync; // Compatible with node 0.6 and 0.8

      if (!existsSync(filepath)) {
        next();
        return;
{'fraction_non_alphanumeric': 0.14859154929577464, 'fraction_numerical': 0.0028169014084507044, 'mean_word_length': 3.68976897689769, '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': '6132462', 'n_tokens_mistral': 433, 'n_tokens_neox': 415, 'n_words': 100}