<commit_before>const path = require('path')
require('app-module-path').addPath(path.resolve(__dirname, '..'))

const express = require('express')
require('express-async-errors')
const bodyParser = require('body-parser')
const config = require('config')
const logger = require('app/logger')
const partialResponse = require('express-partial-response')
const requestID = require('express-request-id')
const cookieParser = require('cookie-parser')
require('app/middleware/ip')

const app = express()

app.set('trust proxy', false)
app.use(cookieParser())
app.use(require('app/middleware/logger'))
app.use(require('app/middleware/i18n'))
app.use(requestID())
app.use(partialResponse())
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({ extended: true }))

app.use(require('./middleware/cors'))

app.use(require('./router/version'))
app.use(require('./router/req'))

app.use(require('./middleware/error-handler'))

const server = app.listen(config.port, () => {
  const address = server.address()
  logger.info(`listen ${address.address}:${address.port}`)
})

module.exports = app<commit_msg>set "trust proxy" to true<commit_after>const path = require('path')
require('app-module-path').addPath(path.resolve(__dirname, '..'))

const express = require('express')
require('express-async-errors')
const bodyParser = require('body-parser')
const config = require('config')
const logger = require('app/logger')
const partialResponse = require('express-partial-response')
const requestID = require('express-request-id')
const cookieParser = require('cookie-parser')
require('app/middleware/ip')

const app = express()

// for x-forwarded-proto
app.set('trust proxy', true)
app.use(cookieParser())
app.use(require('app/middleware/logger'))
app.use(require('app/middleware/i18n'))
app.use(requestID())
app.use(partialResponse())
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({ extended: true }))

app.use(require('./middleware/cors'))

app.use(require('./router/version'))
app.use(require('./router/req'))

app.use(require('./middleware/error-handler'))

const server = app.listen(config.port, () => {
  const address = server.address()
  logger.info(`listen ${address.address}:${address.port}`)
})

module.exports = app
{'fraction_non_alphanumeric': 0.19047619047619047, 'fraction_numerical': 0.0017969451931716084, 'mean_word_length': 6.626712328767123, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5947920', 'n_tokens_mistral': 685, 'n_tokens_neox': 679, 'n_words': 117}