<commit_before>const express = require('express');
const path    = require('path');
const bodyParser = require('body-parser');
const cloudinary = require('cloudinary');

/*** Webpack imports ***/
const webpack  = require('webpack');
const config   = require('./webpack.config.js');
const fs = require('fs');

const webpackMiddleware    = require('webpack-dev-middleware');
const webpackHotMiddleware = require('webpack-hot-middleware');

var app = express();

const compiler = webpack(config);
const webpackOptions = {
    publicPath: config.output.publicPath,
    quiet: false,
    // hides all the bundling file names
    noInfo: true,
    // adds color to the terminal
    stats: {
        colors: true
    }
};
const isProduction = process.env.NODE_ENV === 'production';
const staticPath = path.join(__dirname, 'build');

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
if (!isProduction) {
    app.use(webpackMiddleware(compiler, webpackOptions));
    app.use(webpackHotMiddleware(compiler));

    app.get('*', (req, res) => {
        res.sendFile(path.join(__dirname, 'index.html'));
    });

} else {
    app.use(express.static(staticPath))
        .get('/', (req, res) => {
            res.sendFile('index.html', {
                root: staticPath
            });
        });

}

app.all('/img', (req, res) => {

    const { name, imageUrl } = req.body;
    const configFile = require('./cloudinary.config.json');
    cloudinary.config(configFile);
    const options = {
        public_id: name,
        format: 'png'
    };

    cloudinary.uploader.upload(
        imageUrl,
        (result) => console.log(result),
        options
    );
});

module.exports = app;<commit_msg>fix(deployment): heroku<commit_after>const express = require('express');
const path    = require('path');
const bodyParser = require('body-parser');
const cloudinary = require('cloudinary');

/*** Webpack imports ***/
const webpack  = require('webpack');
const config   = require('./webpack.config.js');
const fs = require('fs');

const webpackMiddleware    = require('webpack-dev-middleware');
const webpackHotMiddleware = require('webpack-hot-middleware');

var app = express();

const compiler = webpack(config);
const webpackOptions = {
    publicPath: config.output.publicPath,
    quiet: false,
    // hides all the bundling file names
    noInfo: true,
    // adds color to the terminal
    stats: {
        colors: true
    }
};
const isProduction = process.env.NODE_ENV === 'production';
const staticPath = path.join(__dirname, 'build');

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
if (!isProduction) {
    app.use(webpackMiddleware(compiler, webpackOptions));
    app.use(webpackHotMiddleware(compiler));

    app.get('*', (req, res) => {
        res.sendFile(path.join(__dirname, 'index.html'));
    });

} else {
    app.use(express.static(staticPath))
        .get('/', (req, res) => {
            res.sendFile('index.html', {
                root: staticPath
            });
        });

}

app.all('/img', (req, res) => {

    const name = req.body.name;
    const imageUrl = req.body.imageUrl
    const configFile = require('./cloudinary.config.json');
    cloudinary.config(configFile);
    const options = {
        public_id: name,
        format: 'png'
    };

    cloudinary.uploader.upload(
        imageUrl,
        (result) => console.log(result),
        options
    );
});

module.exports = app;
{'fraction_non_alphanumeric': 0.15928694652098907, 'fraction_numerical': 0.0, 'mean_word_length': 3.1318289786223277, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '6142064', 'n_tokens_mistral': 1040, 'n_tokens_neox': 1034, 'n_words': 224}