<commit_before>import express from 'express';
import path from 'path';
import compression from 'compression';
import bodyParser from 'body-parser';
import favicon from 'serve-favicon';
import herokuSslRedirect from 'heroku-ssl-redirect';
import multer from 'multer';
import mongoose from 'mongoose';
import io from 'socket.io';
import apiRoutes from 'src/server/routes/api-routes';
import migrationRoutes from 'src/server/routes/migration-routes';
import mime from 'mime-types';
import publishAllApi from 'src/server/api/publish-all';
import publishApi from 'src/server/api/publish';
import unpublishApi from 'src/server/api/unpublish';
import unsubscribe from 'src/server/api/unsubscribe';
import notifySubscribers from 'src/server/api/notify-subscribers';
import { getTipps, postTipp } from 'src/server/api/tipps';
import putDrawing from 'src/server/api/put-drawing';
import { postSubscriber } from 'src/server/api/subscriber';
import { postImage, deleteImages } from 'src/server/api/images';
import { postSpamReport } from 'src/server/api/spamreport';
import passport from 'src/config/passport';

const app = express();
const uploader = multer();

// Attach socket io for initialization in bin/www
app.io = io();

// Connect to mongoDB
mongoose.connect(process.env.MONGODB_CONNECTION_STRING)
  .then(() => {
    /* eslint no-console: 0 */
    console.log('Connected to mongodb server');
    // mongoose.connection.db.dropCollection('posts');
  })
  .catch((err) => { console.error(err); });

app.use(passport.initialize());

// View engine settings
app.set('views', './server/views');
app.set('view engine', 'pug');

// Redirect to https
app.use(herokuSslRedirect());

// Gzip all the things
app.use(compression());
<commit_msg>Purge no more<commit_after>import express from 'express';
import path from 'path';
import compression from 'compression';
import bodyParser from 'body-parser';
import favicon from 'serve-favicon';
import herokuSslRedirect from 'heroku-ssl-redirect';
import multer from 'multer';
import mongoose from 'mongoose';
import io from 'socket.io';
import apiRoutes from 'src/server/routes/api-routes';
import migrationRoutes from 'src/server/routes/migration-routes';
import mime from 'mime-types';
import publishAllApi from 'src/server/api/publish-all';
import publishApi from 'src/server/api/publish';
import unpublishApi from 'src/server/api/unpublish';
import unsubscribe from 'src/server/api/unsubscribe';
import notifySubscribers from 'src/server/api/notify-subscribers';
import { getTipps, postTipp } from 'src/server/api/tipps';
import putDrawing from 'src/server/api/put-drawing';
import { postSubscriber } from 'src/server/api/subscriber';
import { postImage, deleteImages } from 'src/server/api/images';
import { postSpamReport } from 'src/server/api/spamreport';
import passport from 'src/config/passport';

const app = express();
const uploader = multer();

// Attach socket io for initialization in bin/www
app.io = io();

// Connect to mongoDB
mongoose.connect(process.env.MONGODB_CONNECTION_STRING)
  .then(() => {
    /* eslint no-console: 0 */
    console.log('Connected to mongodb server');
  })
  .catch((err) => { console.error(err); });

app.use(passport.initialize());

// View engine settings
app.set('views', './server/views');
app.set('view engine', 'pug');

// Redirect to https
app.use(herokuSslRedirect());

// Gzip all the things
app.use(compression());

{'fraction_non_alphanumeric': 0.1408864103316701, 'fraction_numerical': 0.000587026709715292, 'mean_word_length': 5.241758241758242, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '1819926', 'n_tokens_mistral': 1064, 'n_tokens_neox': 1071, 'n_words': 285}