<commit_before>import http from 'http'
import express from 'express'
import path from 'path'
import compression from 'compression'

import { port } from '../config'
import routes from './routes'
import middlewares from './middlewares'

const app = express()

// Set the view engine
app.set('view engine', 'pug')
// Set the views folder
app.set('views', path.join(__dirname, 'views'))

app.use(express.static(path.join(__dirname, '../../static')))
app.use('/', routes)

// compress all requests
app.use(compression())

// catch 404 and forward to error handler
app.use(middlewares.notFound)

// error handler
app.use(middlewares.internalError)
<commit_msg>Add compression filter function<commit_after>import http from 'http'
import express from 'express'
import path from 'path'
import compression from 'compression'

import { port } from '../config'
import routes from './routes'
import middlewares from './middlewares'

const app = express()

// Set the view engine
app.set('view engine', 'pug')
// Set the views folder
app.set('views', path.join(__dirname, 'views'))

app.use(express.static(path.join(__dirname, '../../static')))
app.use('/', routes)

// compress all requests
app.use(compression({
  filter: () => true
}))

// catch 404 and forward to error handler
app.use(middlewares.notFound)

// error handler
app.use(middlewares.internalError)

{'fraction_non_alphanumeric': 0.14866863905325445, 'fraction_numerical': 0.004437869822485207, 'mean_word_length': 4.614107883817427, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '4969059', 'n_tokens_mistral': 407, 'n_tokens_neox': 404, 'n_words': 133}