<commit_before># Middleware to control the rest of the requests.
hbs = require 'hbs'
pathRegexp = require 'path-to-regexp'
express = require 'express'
_ = require 'underscore'

config = require '../config'
Route = require '../models/route'

module.exports = app = express()
tplPath = config.buckets?.templatePath

require('../lib/renderer')(hbs)

app.set 'views', tplPath

app.set 'view cache', false<commit_msg>Add an inspect helper<commit_after># Middleware to control the rest of the requests.
hbs = require 'hbs'
pathRegexp = require 'path-to-regexp'
express = require 'express'
_ = require 'underscore'

config = require '../config'
Route = require '../models/route'

module.exports = app = express()
tplPath = config.buckets?.templatePath

hbs.registerHelper 'inspect', (thing, options) ->
  thing = thing or @
  new hbs.handlebars.SafeString "<pre>#{JSON.stringify(thing, null, 2)}</pre>"

require('../lib/renderer')(hbs)

app.set 'views', tplPath

app.set 'view cache', false
{'fraction_non_alphanumeric': 0.14852492370295015, 'fraction_numerical': 0.001017293997965412, 'mean_word_length': 4.655172413793103, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '750718', 'n_tokens_mistral': 319, 'n_tokens_neox': 318, 'n_words': 92}