<commit_before>// modules
var express = require('express');
var bodyParser = require('body-parser');
var config = require('../config/config');
var path = require('path');
var morgan = require('morgan');
var Parse = require('parse/node').Parse;
var fs = require('fs');
var uglify = require('uglify-js');

// instantiate express app
var app = express();

module.exports = function () {

    // use body parser & cookie parser
    app.use(bodyParser.urlencoded({extended: true}));
    app.use(bodyParser.json());

    Parse.initialize(config.apis_keys.parse_app_key, config.apis_keys.parse_client_key);

    Parse.Config.get().then(function (psConfig) {
        var api_keys = psConfig.get("api_keys");

        config.apis_keys.youtube = api_keys.youtube;
        config.apis_keys.soundcloud_client_id = api_keys.soundcloud_client_id;

    });

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

    // static roots
    app.use('/css', express.static(path.resolve('./public/css')));
    app.use('/libs', express.static(path.resolve('./public/libs')));
    app.use('/js', express.static(path.resolve('./public/js')));
    app.use('/images', express.static(path.resolve('./public/images')));
    app.use('/scripts', express.static(path.resolve('./node_modules')));
    app.use('/views', express.static(path.resolve('./public/views')));

    // minify js files
    var uglified = uglify.minify([
        './node_modules/bootstrap/dist/js/bootstrap.min.js',
        './public/libs/soundcloud-audio/soundcloud-audio.js',
        './node_modules/angular/angular.min.js',
        './node_modules/angular-route/angular-route.min.js',<commit_msg>Update express.js<commit_after>// modules
var express = require('express');
var bodyParser = require('body-parser');
var config = require('../config/config');
var path = require('path');
var morgan = require('morgan');
var Parse = require('parse/node').Parse;
var fs = require('fs');
var uglify = require('uglify-js');

// instantiate express app
var app = express();

module.exports = function () {

    // use body parser & cookie parser
    app.use(bodyParser.urlencoded({extended: true}));
    app.use(bodyParser.json());

    Parse.initialize(config.apis_keys.parse_app_key, config.apis_keys.parse_client_key);

    Parse.Config.get().then(function (psConfig) {
        var api_keys = psConfig.get("api_keys");

        config.apis_keys.youtube = api_keys.youtube;
        config.apis_keys.soundcloud_client_id = api_keys.soundcloud_client_id;

    });
    
    process.env.NODE_ENV = config.server.env;

    if (process.env.NODE_ENV === 'dev') app.use(morgan('dev'));

    // static roots
    app.use('/css', express.static(path.resolve('./public/css')));
    app.use('/libs', express.static(path.resolve('./public/libs')));
    app.use('/js', express.static(path.resolve('./public/js')));
    app.use('/images', express.static(path.resolve('./public/images')));
    app.use('/scripts', express.static(path.resolve('./node_modules')));
    app.use('/views', express.static(path.resolve('./public/views')));

    // minify js files
    var uglified = uglify.minify([
        './node_modules/bootstrap/dist/js/bootstrap.min.js',
        './public/libs/soundcloud-audio/soundcloud-audio.js',
        './node_modules/angular/angular.min.js',
        './node_modules/angular-route/angular-route.min.js',
{'fraction_non_alphanumeric': 0.1863129333735303, 'fraction_numerical': 0.0, 'mean_word_length': 3.6930693069306932, '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': '5349428', 'n_tokens_mistral': 1047, 'n_tokens_neox': 1028, 'n_words': 161}