<commit_before>import path from 'path'
import fse from 'fs-extra'

import {
  coreUtils,
  config,
  abeExtend
} from '../../cli'

var middleware = function(req, res, next) {
  if (req.originalUrl.indexOf('/abe') > -1) {
    return next()
  }

  if (req.originalUrl === '' || req.originalUrl === '/' || req.originalUrl.indexOf('.') === -1) {
    res.redirect('/abe')
  } else if (req.originalUrl.indexOf('.' + config.files.templates.extension) > -1) {

    html = ''

    var page = path.join(config.root, config.publish.url, req.originalUrl)
    if (coreUtils.file.exist(page)) {
      html = fse.readFileSync(page, 'utf8')
    }else {
      return next()
    }<commit_msg>fix: var not defined<commit_after>import path from 'path'
import fse from 'fs-extra'

import {
  coreUtils,
  config,
  abeExtend
} from '../../cli'

var middleware = function(req, res, next) {
  if (req.originalUrl.indexOf('/abe') > -1) {
    return next()
  }

  if (req.originalUrl === '' || req.originalUrl === '/' || req.originalUrl.indexOf('.') === -1) {
    res.redirect('/abe')
  } else if (req.originalUrl.indexOf('.' + config.files.templates.extension) > -1) {

    var html = ''

    var page = path.join(config.root, config.publish.url, req.originalUrl)
    if (coreUtils.file.exist(page)) {
      html = fse.readFileSync(page, 'utf8')
    }else {
      return next()
    }
{'fraction_non_alphanumeric': 0.18763796909492272, 'fraction_numerical': 0.005886681383370125, 'mean_word_length': 2.9882697947214076, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '6939707', 'n_tokens_mistral': 474, 'n_tokens_neox': 468, 'n_words': 102}