<commit_before>// Requier all the dependences.
var express    = require('express'),
    bodyParser = require('body-parser'),
    mongoose   = require('mongoose'),
    seedDB     = require('./seeds');

// Set the app
var app = express();
seedDB();

// Require Models.
var Campground = require('./models/campground'),
    Comment    = require('./models/comment');

// Serve the assets like css, js and fonts files.
app.use(express.static(__dirname + '/public'));

// Configure the app:
app.set('view engine', 'ejs');
app.use(bodyParser.urlencoded({ extended: true }));

// ===============
// DB Setup ======
// ===============

// Connect to the mongodb database.
mongoose.connect(process.env.MONGODB_URI || 'mongodb://localhost/yelp_camp');

// =============
// ROUTES ======
// =============<commit_msg>Add passport and passport plugins. Setup passport.<commit_after>// Requier all the dependences.
var express               = require('express'),
    bodyParser            = require('body-parser'),
    mongoose              = require('mongoose'),
    passport              = require('passport'),
    seedDB                = require('./seeds'),
    LocalStrategy         = require('passport-local'),
    passportLocalMongoose = require('passport-local-mongoose');

// ===============
// DB Setup ======
// ===============

// Connect to the mongodb database.
mongoose.connect(process.env.MONGODB_URI || 'mongodb://localhost/yelp_camp');

// ===============
// App Setup ======
// ===============

// Set the app
var app = express();

// Create fake data to display.
seedDB();

// Require Models.
var Campground = require('./models/campground'),
    Comment    = require('./models/comment'),
    User       = require('./models/user');

// Serve the assets like css, js and fonts files.
app.use(express.static(__dirname + '/public'));

// Configure the app:
app.set('view engine', 'ejs');
app.use(bodyParser.urlencoded({ extended: true }));

// =====================
// Passport Setup ======
// =====================
app.use(require('express-session')({
    secret: "The world is yours",
    resave: false,
    saveOnInitialized: false
}));
app.use( passport.initilized() );
app.use( passport.session() );
passport.use( new LocalStrategy(User.authenticated));
passport.serializeUser( User.serializeUser() );
passport.deserializeUser( User.deserializeUser() );


// =============
// ROUTES ======
// =============
{'fraction_non_alphanumeric': 0.24066390041493776, 'fraction_numerical': 0.0, 'mean_word_length': 3.4565619223659887, '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': '4270587', 'n_tokens_mistral': 711, 'n_tokens_neox': 686, 'n_words': 160}