<commit_before>import express from 'express'
import mongoose from 'mongoose'
import modRewrite from 'connect-modrewrite';
import helmet from 'helmet';

import morgan from 'morgan';

import session from 'express-session';
import connectRedis from 'connect-redis';

import Webpack from './webpack';

// Routes
import imageRouter from './routes/image-api';
import galleryRouter from './routes/gallery-api';
import authRouter from './routes/auth-api';
import userRoleRouter from './routes/user-role-api';

import config from './config';

mongoose.promise = global.Promise;
mongoose.connect(`mongodb://${config.database.host}/${config.database.name}`);

const app = express();

const RedisStore = connectRedis(session);
const sessionMiddleware = session({
  store: new RedisStore({
    host: config.redis.host,
    port: 6379
  }),
  secret: config.session.secret,
  resave: false,<commit_msg>use new mongoose url parser<commit_after>import express from 'express'
import mongoose from 'mongoose'
import modRewrite from 'connect-modrewrite';
import helmet from 'helmet';

import morgan from 'morgan';

import session from 'express-session';
import connectRedis from 'connect-redis';

import Webpack from './webpack';

// Routes
import imageRouter from './routes/image-api';
import galleryRouter from './routes/gallery-api';
import authRouter from './routes/auth-api';
import userRoleRouter from './routes/user-role-api';

import config from './config';

mongoose.promise = global.Promise;
mongoose.connect(`mongodb://${config.database.host}/${config.database.name}`, { useNewUrlParser: true });

const app = express();

const RedisStore = connectRedis(session);
const sessionMiddleware = session({
  store: new RedisStore({
    host: config.redis.host,
    port: 6379
  }),
  secret: config.session.secret,
  resave: false,
{'fraction_non_alphanumeric': 0.13208585580627408, 'fraction_numerical': 0.004402861860209136, 'mean_word_length': 5.080267558528428, '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': '6303844', 'n_tokens_mistral': 542, 'n_tokens_neox': 547, 'n_words': 157}