<commit_before>const express = require('express');
const httpProxy = require('http-proxy');

const app = express();
const proxy = httpProxy.createProxyServer({});
const port = process.env.PORT || 3000;

if (process.env.NODE_ENV === 'production') {
    app.set('trust proxy', true);
}

app.use(express.static(__dirname + '/app'));


app.use('/api', function (req, res) {
    proxy.web(req, res, { target: process.env.GEOGW_ROOT_URL || 'http://localhost:5000/api' });
});

app.get('*', function (req, res) {
    res.sendFile(__dirname + '/app/views/layout.html');
});

app.listen(port, function () {
    console.log('Now listing on port %d', port);
});<commit_msg>Fix embedded proxy config<commit_after>const express = require('express');
const httpProxy = require('http-proxy');

const app = express();
const proxy = httpProxy.createProxyServer({});
const port = process.env.PORT || 3000;

if (process.env.NODE_ENV === 'production') {
    app.set('trust proxy', true);
}

app.use(express.static(__dirname + '/app'));


app.use('/api', function (req, res) {
    proxy.web(req, res, { changeOrigin: true, target: process.env.GEOGW_ROOT_URL || 'http://localhost:5000/api' });
});

app.get('*', function (req, res) {
    res.sendFile(__dirname + '/app/views/layout.html');
});

app.listen(port, function () {
    console.log('Now listing on port %d', port);
});
{'fraction_non_alphanumeric': 0.20206489675516223, 'fraction_numerical': 0.011799410029498525, 'mean_word_length': 4.701680672268908, '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': '3451169', 'n_tokens_mistral': 459, 'n_tokens_neox': 440, 'n_words': 99}