<commit_before>import path from 'path'
import express from 'express'
import ejs from 'ejs'
import expressLayouts from 'express-ejs-layouts'
import middlewares, { httpProxy, errorHandler } from './middlewares'
import routes from './routes'
import connectMongoDB from './config/mongoose'
import setupPassport from './config/passport'

connectMongoDB()
setupPassport()

const app = express()

httpProxy(app)

app.set('views', path.join(__dirname, 'views'))
app.set('view engine', 'html')
app.engine('html', ejs.renderFile)
app.use(expressLayouts)
app.use(express.static(path.resolve(__dirname, '../static')))

app.use(middlewares())
app.use(routes())
app.use(errorHandler())

export default app
<commit_msg>refactor: app<commit_after>import path from 'path'
import express from 'express'
import ReactEngine from 'react-engine'
import middlewares, { httpProxy, errorHandler } from './middlewares'
import routes from './routes'
import connectMongoDB from './config/mongoose'
import setupPassport from './config/passport'

connectMongoDB()
setupPassport()

global.navigator = global.navigator || {}
global.navigator.userAgent = global.navigator.userAgent || 'all'

const app = express()

httpProxy(app)

const engine = ReactEngine.server.create({
  routes: require('./views/routes'),
  routesFilePath: path.join(__dirname, '/views/routes.js'),
  performanceCollector: (stats) => console.log(stats)
})

app.engine('js', engine)
app.set('views', path.join(__dirname, 'views'))
app.set('view engine', 'js')
app.set('view', ReactEngine.expressView)
app.use(express.static(path.resolve(__dirname, '../static')))

app.use(middlewares())
app.use(routes())
app.use(errorHandler())

export default app

{'fraction_non_alphanumeric': 0.15411973918197985, 'fraction_numerical': 0.0, 'mean_word_length': 6.275862068965517, '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': '4770452', 'n_tokens_mistral': 525, 'n_tokens_neox': 534, 'n_words': 128}