<commit_before>'use strict';
'use strict';
/**
 * Routes initializer. Dynamic loading of
 * all entry points in `.js` files inside app/routes.
 *
 * @module router
 */
const Router = require('koa-router');
const _ = require('lodash');
const log = require('logger');
const glob = require('glob');
const path = require('path');

const ROUTES_PATH = path.join(__dirname, 'routes');

module.exports = function(options) {
  options = options || {};
  var router = new Router(options);
  _.each(glob.sync(path.join(ROUTES_PATH, '**/*.js')), (file) => {
    var route = path.parse(file);
    route = path.join(route.dir, route.name);

    log.info('Configuring routes for [%s%s]', options.prefix || '', route.substr(ROUTES_PATH.length));
    require(route)(router);
  });
  return router;
};<commit_msg>Allow setting no namespace<commit_after>'use strict';
'use strict';
/**
 * Routes initializer. Dynamic loading of
 * all entry points in `.js` files inside app/routes.
 *
 * @module router
 */
const Router = require('koa-router');
const _ = require('lodash');
const log = require('logger');
const glob = require('glob');
const path = require('path');

const ROUTES_PATH = path.join(__dirname, 'routes');

module.exports = function(options) {
  options = _.merge({}, options);
  var router = new Router(options);
  _.each(glob.sync(path.join(ROUTES_PATH, '**/*.js')), (file) => {
    var route = path.parse(file);
    route = path.join(route.dir, route.name);

    log.info('Configuring routes for [%s%s]', options.prefix || '', route.substr(ROUTES_PATH.length));
    require(route)(router);
  });
  return router;
};
{'fraction_non_alphanumeric': 0.18238213399503722, 'fraction_numerical': 0.0, 'mean_word_length': 4.48639455782313, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3162876', 'n_tokens_mistral': 523, 'n_tokens_neox': 520, 'n_words': 130}