<commit_before>module.exports = LdpMiddleware

var express = require('express')
var header = require('./header')
var acl = require('./acl')
var authentication = require('./authentication')
var get = require('./handlers/get')
var post = require('./handlers/post')
var put = require('./handlers/put')
var del = require('./handlers/delete')
var patch = require('./handlers/patch')
var errorPages = require('./handlers/error-pages')

function LdpMiddleware (corsSettings) {
  var router = express.Router('/')

  // Add Link headers
  router.use(header.linksHandler)
  if (corsSettings) {
    router.use(corsSettings)
  }

  router.use('/*', authentication)
  router.get('/*', acl.allow('Read'), get)
  router.post('/*', acl.allow('Append'), post)
  router.patch('/*', acl.allow('Append'), patch)
  router.put('/*', acl.allow('Append'), put)
  router.delete('/*', acl.allow('Write'), del)

  // Errors
  router.use(errorPages)

  // TODO: in the process of being deprecated
  // Convert json-ld and nquads to turtle
  // router.use('/*', parse.parseHandler)

  return router
}
<commit_msg>importing the right file<commit_after>module.exports = LdpMiddleware

var express = require('express')
var header = require('./header')
var acl = require('./acl')
var authentication = require('./handlers/authentication')
var get = require('./handlers/get')
var post = require('./handlers/post')
var put = require('./handlers/put')
var del = require('./handlers/delete')
var patch = require('./handlers/patch')
var errorPages = require('./handlers/error-pages')

function LdpMiddleware (corsSettings) {
  var router = express.Router('/')

  // Add Link headers
  router.use(header.linksHandler)
  if (corsSettings) {
    router.use(corsSettings)
  }

  router.use('/*', authentication)
  router.get('/*', acl.allow('Read'), get)
  router.post('/*', acl.allow('Append'), post)
  router.patch('/*', acl.allow('Append'), patch)
  router.put('/*', acl.allow('Append'), put)
  router.delete('/*', acl.allow('Write'), del)

  // Errors
  router.use(errorPages)

  // TODO: in the process of being deprecated
  // Convert json-ld and nquads to turtle
  // router.use('/*', parse.parseHandler)

  return router
}

{'fraction_non_alphanumeric': 0.18692870201096892, 'fraction_numerical': 0.0, 'mean_word_length': 4.1505882352941175, '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': '4401069', 'n_tokens_mistral': 692, 'n_tokens_neox': 679, 'n_words': 165}