<commit_before>const config = require('../config');
const path = require('path');
const hbs = require('express-hbs');
const express = require('express');
const bodyParser = require('body-parser');
const multer = require('multer');
const compression = require('compression');

module.exports = function() {
    let app = express();

    app.locals.title = config.app.title;
    app.locals.description = config.app.description;

    app.locals.jsFiles = config.files.client.js;
    app.locals.cssFiles = config.files.client.css;

    app.use(bodyParser.urlencoded({ extended: true }));
    app.use(bodyParser.json());

    app.use(compression());

    app.use(express.static(path.join(process.cwd(), 'public')));

    app.engine('server.view.html', hbs.express4({ extname: '.server.view.html' }));
    app.set('view engine', 'server.view.html');
    app.set('views', path.join(process.cwd(), 'server/views'));

    app.use(multer({
        dest: './public/uploads/',
        limits: {
            files: 1,
            fileSize: 1024 * 1024 * 100
        }
    }).single('file'));

    app.set('port', config.port);

    return app;
};<commit_msg>Enable proxy<commit_after>const config = require('../config');
const path = require('path');
const hbs = require('express-hbs');
const express = require('express');
const bodyParser = require('body-parser');
const multer = require('multer');
const compression = require('compression');

module.exports = function() {
    let app = express();

    app.locals.title = config.app.title;
    app.locals.description = config.app.description;

    app.locals.jsFiles = config.files.client.js;
    app.locals.cssFiles = config.files.client.css;

    app.use(bodyParser.urlencoded({ extended: true }));
    app.use(bodyParser.json());

    app.use(compression());

    app.use(express.static(path.join(process.cwd(), 'public')));

    app.engine('server.view.html', hbs.express4({ extname: '.server.view.html' }));
    app.set('view engine', 'server.view.html');
    app.set('views', path.join(process.cwd(), 'server/views'));

    app.use(multer({
        dest: './public/uploads/',
        limits: {
            files: 1,
            fileSize: 1024 * 1024 * 100
        }
    }).single('file'));

    app.set('port', config.port);

    app.enable('trust proxy');

    return app;
};
{'fraction_non_alphanumeric': 0.1852649719948298, 'fraction_numerical': 0.01120206807410599, 'mean_word_length': 3.332089552238806, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2734293', 'n_tokens_mistral': 759, 'n_tokens_neox': 716, 'n_words': 135}