<commit_before>// application

const express = require('express'),
    app = express(),
    env = process.env.NODE_ENV || 'development',
    sessionSecret = process.env.COOKIE_SECRET || '123456',
    config  = require('./config'),
    setupHandlebars  = require('./config/setupHandlebars.js'),
    setupPassport = require('./app/setupPassport'),
    flash = require('connect-flash'),
    morgan = require('morgan'),
    appRouter = require('./app/routers/appRouter.js')(express),
    session = require('express-session'),
    bodyParser = require('body-parser'),
    cookieParser = require('cookie-parser'),
    pgSession = require('connect-pg-simple')(session),
    pg = require('pg'),
    port = config.PORT,
    pgdb = config.DATABASE_URL,
    jsonParser = bodyParser.json(),
    upload = require('multer')();

app.use(cookieParser());
app.use(session({
  store: new pgSession({
    pg : pg,
    conString : pgdb, // Connect using something else than default DATABASE_URL env variable
  }),
  secret: sessionSecret,
  resave: false,
  saveUninitialized: true,
  cookie: { maxAge: 360 * 24 * 60 * 60 * 1000 } // 360 days
}));

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

app.use(flash());
app.use(function (req, res, next) {
    res.locals.errorMessages = req.flash('errors');
    next();
});

// Logs
const predefined = env === 'development' ? 'dev' : 'combined';
if (env !== 'test') app.use(morgan(predefined));

app.use(jsonParser);
app.use(bodyParser.urlencoded({
  extended: true
}));
app.use(upload.single('image'));

setupPassport(app);
setupHandlebars(app);
<commit_msg>killing store.<commit_after>// application

const express = require('express'),
    app = express(),
    env = process.env.NODE_ENV || 'development',
    sessionSecret = process.env.COOKIE_SECRET || '123456',
    config  = require('./config'),
    setupHandlebars  = require('./config/setupHandlebars.js'),
    setupPassport = require('./app/setupPassport'),
    flash = require('connect-flash'),
    morgan = require('morgan'),
    appRouter = require('./app/routers/appRouter.js')(express),
    session = require('express-session'),
    bodyParser = require('body-parser'),
    cookieParser = require('cookie-parser'),
    pgSession = require('connect-pg-simple')(session),
    pg = require('pg'),
    port = config.PORT,
    pgdb = config.DATABASE_URL,
    jsonParser = bodyParser.json(),
    upload = require('multer')();

app.use(cookieParser());
app.use(session({
  // store: new pgSession({
  //   pg : pg,
  //   conString : pgdb, // Connect using something else than default DATABASE_URL env variable
  // }),
  secret: sessionSecret,
  resave: false,
  saveUninitialized: true,
  cookie: { maxAge: 360 * 24 * 60 * 60 * 1000 } // 360 days
}));

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

app.use(flash());
app.use(function (req, res, next) {
    res.locals.errorMessages = req.flash('errors');
    next();
});

// Logs
const predefined = env === 'development' ? 'dev' : 'combined';
if (env !== 'test') app.use(morgan(predefined));

app.use(jsonParser);
app.use(bodyParser.urlencoded({
  extended: true
}));
app.use(upload.single('image'));

setupPassport(app);
setupHandlebars(app);

{'fraction_non_alphanumeric': 0.17878315132605305, 'fraction_numerical': 0.013728549141965678, 'mean_word_length': 4.017214397496088, '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': '686910', 'n_tokens_mistral': 1051, 'n_tokens_neox': 1003, 'n_words': 211}