<commit_before>var app = require('../../'),
    buffet = require('buffet'),
    path = require('path');

app.conf.add({
  static: {
    'path': './public',
    'notFound': true
  }
});

app.on('init', function () {
  var conf = app.conf.get('static');

  // Resolve root to the app root.
  var rootPath = path.resolve(app.root, conf.path);

  // Create buffet middleware.
  var buffetMiddleware = buffet(rootPath, conf);

  // Add buffet to middler stack.
  app.middleware.add(buffetMiddleware);

  // Optionally add buffet notFound handler.
  if (conf.notFound) {
    app.middleware.last(buffetMiddleware.notFound);
  }

  app.buffet = buffet;
});<commit_msg>Static middleware doesn't need to be in 'init'.<commit_after>var app = require('../../'),
    buffet = require('buffet'),
    path = require('path');

app.conf.add({
  static: {
    'path': './public',
    'notFound': true
  }
});

var conf = app.conf.get('static');

// Resolve root to the app root.
var rootPath = path.resolve(app.root, conf.path);

// Create buffet middleware.
var buffetMiddleware = buffet(rootPath, conf);

// Add buffet to middler stack.
app.middleware.add(buffetMiddleware);

// Optionally add buffet notFound handler.
if (conf.notFound) {
  app.middleware.last(buffetMiddleware.notFound);
}

app.buffet = buffet;
{'fraction_non_alphanumeric': 0.16576715497301464, 'fraction_numerical': 0.0, 'mean_word_length': 3.430034129692833, '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': '5865330', 'n_tokens_mistral': 442, 'n_tokens_neox': 441, 'n_words': 107}