<commit_before>#! /usr/bin/env node
require('dotenv').config({silent: true});

const express = require('express');
const path = require('path');
const morgan = require('morgan');
const bodyParser = require('body-parser');

const db = require('./config/db');
const User = require('./models/users');

const routes = require('./routes/index');
const users = require('./routes/users');
const auth = require('./routes/auth');
const search = require('./routes/search');
const fallback = require('./routes/fallback');

const app = express();

app.use(morgan('dev'));

app.use(bodyParser.urlencoded({extended: true}));

app.use(express.static(path.join(__dirname, 'public')));

app.use('/', routes);
app.use('/users', users);
app.use('/auth', auth);
app.use('/search', search);
app.use('*', fallback);

//404 handler
app.use((req, res, next) => {
  let err = new Error(`404: ${req.originalUrl} Not Found`);
  err.status = 404;
  next(err);
});

app.use((err, req, res, next) => {<commit_msg>adds passport initialization to app.js<commit_after>#! /usr/bin/env node
require('dotenv').config({silent: true});

const express = require('express');
const path = require('path');
const morgan = require('morgan');
const bodyParser = require('body-parser');

const db = require('./config/db');
const User = require('./models/users');

const routes = require('./routes/index');
const users = require('./routes/users');
const auth = require('./routes/auth');
const search = require('./routes/search');
const fallback = require('./routes/fallback');

const app = express();

app.use(morgan('dev'));

app.use(bodyParser.urlencoded({extended: true}));

app.use(express.static(path.join(__dirname, 'public')));

app.use(express.session({ 
  secret: 'huntersruleyall' 
}))
app.use(passport.initialize());
app.use(passport.session());

app.use('/', routes);
app.use('/users', users);
app.use('/auth', auth);
app.use('/search', search);
app.use('*', fallback);

//404 handler
app.use((req, res, next) => {
  let err = new Error(`404: ${req.originalUrl} Not Found`);
  err.status = 404;
  next(err);
});

app.use((err, req, res, next) => {
{'fraction_non_alphanumeric': 0.22337908187411262, 'fraction_numerical': 0.008518693800283956, 'mean_word_length': 5.3104477611940295, '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': '1491613', 'n_tokens_mistral': 695, 'n_tokens_neox': 688, 'n_words': 159}