<commit_before>/**
 * /config/express.js
 *
 * This file contains all custom middlewares for Taskboard application.
 *
 * @type {*}
 */

var passport = require('passport');

module.exports.express = {
    customMiddleware: function (app) {
        // Add passport middleware
        app.use(passport.initialize());
        app.use(passport.session());

        // Add some basic data for all views
        app.use(function(req, res, next) {
            res.locals.currentUser = req.user;

            next();
        });
    }
};<commit_msg>Added moment.js library to all views.<commit_after>/**
 * /config/express.js
 *
 * This file contains all custom middlewares for Taskboard application.
 *
 * @type {*}
 */

var passport = require("passport");
var moment = require("moment-timezone");

module.exports.express = {
    customMiddleware: function (app) {
        // Add passport middleware
        app.use(passport.initialize());
        app.use(passport.session());

        // Add some basic data for all views
        app.use(function(req, res, next) {
            if (req.user && req.user.language) {
                moment.lang(req.user.language);
            }

            res.locals.currentUser = req.user;
            res.locals.moment = moment;

            next();
        });
    }
};
{'fraction_non_alphanumeric': 0.1354888375673595, 'fraction_numerical': 0.0, 'mean_word_length': 2.1553398058252426, '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': '3465913', 'n_tokens_mistral': 376, 'n_tokens_neox': 367, 'n_words': 88}