<commit_before>var fs = require('fs'),
    join = require('path').join,
    express = require('express'),
    exphbs = require('express-handlebars'),
    mongoose = require('mongoose'),
    config = require('./config'),
    app = express(),
    cors = require('cors'),
    bodyParser = require('body-parser'),
    passport = require('passport'),
    LocalStrategy = require('passport-local').Strategy;

app.engine('.hbs', exphbs({extname: '.hbs', defaultLayout: 'home', layoutsDir: 'app/views/layouts/'}));
app.set('view engine', '.hbs');

var connect = function () {
    mongoose.connect(config.db);
};

var port = process.env.PORT || config.PORT;

/*connect();*/

app.use(require('express-session')({
    secret: 'ep enroll ui',
    resave: false,
    saveUninitialized: false
}));
app.use(passport.initialize());
app.use(passport.session());
app.use(cors());

// Bootstrap models
fs.readdirSync(join(__dirname, 'models')).forEach(function (file) {
    if (~file.indexOf('.js')) require(join(__dirname, 'models', file));
});
var Users = mongoose.model('Users');

passport.use(new LocalStrategy(Users.authenticate()));
passport.serializeUser(Users.serializeUser());
passport.deserializeUser(Users.deserializeUser());

app.set('views', __dirname + '/views/');
app.use(bodyParser.urlencoded({extended: true}));
app.use(express.static(__dirname + '/public'));

// Bootstrap routes
require('./routes')(app);

var server = app.listen(port, function () {<commit_msg>connectdb<commit_after>var fs = require('fs'),
    join = require('path').join,
    express = require('express'),
    exphbs = require('express-handlebars'),
    mongoose = require('mongoose'),
    config = require('./config'),
    app = express(),
    cors = require('cors'),
    bodyParser = require('body-parser'),
    passport = require('passport'),
    LocalStrategy = require('passport-local').Strategy;

app.engine('.hbs', exphbs({extname: '.hbs', defaultLayout: 'home', layoutsDir: 'app/views/layouts/'}));
app.set('view engine', '.hbs');

var connect = function () {
    mongoose.connect(config.db);
};

var port = process.env.PORT || config.PORT;

connect();

app.use(require('express-session')({
    secret: 'ep enroll ui',
    resave: false,
    saveUninitialized: false
}));
app.use(passport.initialize());
app.use(passport.session());
app.use(bodyParser.json({ type: 'application/*+json' }));
app.use(cors());

// Bootstrap models
fs.readdirSync(join(__dirname, 'models')).forEach(function (file) {
    if (~file.indexOf('.js')) require(join(__dirname, 'models', file));
});
var Users = mongoose.model('Users');

passport.use(Users.createStrategy());
passport.serializeUser(Users.serializeUser());
passport.deserializeUser(Users.deserializeUser());

app.set('views', __dirname + '/views/');
app.use(bodyParser.urlencoded({extended: true}));
app.use(express.static(__dirname + '/public'));

// Bootstrap routes
require('./routes')(app);

var server = app.listen(port, function () {
{'fraction_non_alphanumeric': 0.20135363790186125, 'fraction_numerical': 0.0, 'mean_word_length': 5.171189979123174, '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': '3160604', 'n_tokens_mistral': 922, 'n_tokens_neox': 931, 'n_words': 172}