<commit_before>var Environment = require('../config/environment.js');
var env = new Environment();

module.exports = function(app, router) {
    'use strict';
    
    // register all modules
    require('./modules/authentication/auth-controller')(router);
    require('./modules/blog/blog-controller')(router);
    require('./modules/climbing/climbing-controller')(router);
    require('./modules/travel/travel-controller')(router);
    require('./modules/todo/todo-controller')(router);
    require('./modules/places/places-controller')(router);
    require('./modules/portfolio/portfolio-controller')(router);
    require('./modules/gaming/gaming-controller')(router);
    
    // middleware to use for all requests
    router.use(function(req, res, next) {
        next();
    });

    // test route to make sure everything is working (accessed at GET http://localhost:8080/api)
    router.get('/', function(req, res) {
        res.json({ message: 'Welcome to the ianlamb.com web API' });
    });

    // register api routes prefixed with /api
    app.use('/api', router);

    // frontend routes =========================================================
    app.get('*', function(req, res) {
        res.sendfile('./' + env.assetsRoot + '/index.html');
    });

};<commit_msg>change deprecated routing method to the new one<commit_after>var Environment = require('../config/environment.js');
var env = new Environment();

module.exports = function(app, router) {
    'use strict';
    
    // register all modules
    require('./modules/authentication/auth-controller')(router);
    require('./modules/blog/blog-controller')(router);
    require('./modules/climbing/climbing-controller')(router);
    require('./modules/travel/travel-controller')(router);
    require('./modules/todo/todo-controller')(router);
    require('./modules/places/places-controller')(router);
    require('./modules/portfolio/portfolio-controller')(router);
    require('./modules/gaming/gaming-controller')(router);
    
    // middleware to use for all requests
    router.use(function(req, res, next) {
        next();
    });

    // test route to make sure everything is working (accessed at GET http://localhost:8080/api)
    router.get('/', function(req, res) {
        res.json({ message: 'Welcome to the ianlamb.com web API' });
    });

    // register api routes prefixed with /api
    app.use('/api', router);

    // frontend routes =========================================================
    app.get('*', function(req, res) {
        res.sendFile('./' + env.assetsRoot + '/index.html');
    });

};
{'fraction_non_alphanumeric': 0.20955315870570107, 'fraction_numerical': 0.0030816640986132513, 'mean_word_length': 3.4469178082191783, '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': '1591673', 'n_tokens_mistral': 740, 'n_tokens_neox': 711, 'n_words': 151}