<commit_before>var fs = require('fs')
var path = require('path')
var underscore = require('underscore')

var exports = {}

exports.routes = async function (debug, runtime) {
  var i, names
  var entries = {}
  var routes = [
    { method: 'GET',
      path: '/',
      config:
        { handler: function (request, reply) {
          reply('Welcome to the Brave Vault.')
        },
        auth: {
          strategy: 'whitelist',
          mode: 'required'
        }
      }
    }
  ]

  var router = async function (name) {
    var module = require(path.join(__dirname, name))
    var routing = module.routes

    if (typeof module.initialize === 'function') routing = (await module.initialize(debug, runtime)) || routing

    if (!underscore.isArray(routing)) return []

    routing.forEach(route => {
      var entry = route(runtime)
      var key = entry.method + ' ' + entry.path

      if (((typeof entry.config.auth !== 'undefined') || (entry.path.indexOf('/logout') !== -1)) && (!runtime.login)) {
        debug('no authentication configured for route ' + key)
        return
      }

      if (entries[key]) { debug('duplicate route ' + key) } else { entries[key] = true }<commit_msg>simplify /<commit_after>var fs = require('fs')
var path = require('path')
var underscore = require('underscore')

var exports = {}

exports.routes = async function (debug, runtime) {
  var i, names
  var entries = {}
  var routes = [
    { method: 'GET',
      path: '/',
      config:
        { handler: function (request, reply) {
          reply('ack.')
        }
      }
    }
  ]

  var router = async function (name) {
    var module = require(path.join(__dirname, name))
    var routing = module.routes

    if (typeof module.initialize === 'function') routing = (await module.initialize(debug, runtime)) || routing

    if (!underscore.isArray(routing)) return []

    routing.forEach(route => {
      var entry = route(runtime)
      var key = entry.method + ' ' + entry.path

      if (((typeof entry.config.auth !== 'undefined') || (entry.path.indexOf('/logout') !== -1)) && (!runtime.login)) {
        debug('no authentication configured for route ' + key)
        return
      }

      if (entries[key]) { debug('duplicate route ' + key) } else { entries[key] = true }
{'fraction_non_alphanumeric': 0.15384615384615385, 'fraction_numerical': 0.0008791208791208791, 'mean_word_length': 2.624203821656051, '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': '5415595', 'n_tokens_mistral': 677, 'n_tokens_neox': 663, 'n_words': 182}