<commit_before>var fs      = require('fs')
var express = require('express')
var cors    = require('cors')
var http    = require('http')
var path    = require('path')
var low     = require('lowdb')
var utils   = require('./utils')
var routes  = require('./routes')

low._.createId = utils.createId

var server = express()

server.set('port', process.env.PORT || 3000)
server.use(express.logger('dev'))
server.use(express.json())
server.use(express.urlencoded())
server.use(express.methodOverride())

if (fs.existsSync(process.cwd() + '/public')) {
  server.use(express.static(process.cwd() + '/public'));
} else {
  server.use(express.static(path.join(__dirname, './public')));
}

server.use(cors())
server.use(server.router)

if ('development' == server.get('env')) {
  server.use(express.errorHandler());
}

server.get(  '/db'                          , routes.db)
server.get(  '/:resource'                   , routes.list)
server.get(  '/:parent/:parentId/:resource' , routes.list)
server.get(  '/:resource/:id'               , routes.show)

server.post( '/:resource'                   , routes.create)

server.put(  '/:resource/:id'               , routes.update)
server.patch('/:resource/:id'               , routes.update)

server.del(  '/:resource/:id'               , routes.destroy)

server.low = low

module.exports = server<commit_msg>Use .delete instead of .del<commit_after>var fs      = require('fs')
var express = require('express')
var cors    = require('cors')
var http    = require('http')
var path    = require('path')
var low     = require('lowdb')
var utils   = require('./utils')
var routes  = require('./routes')

low._.createId = utils.createId

var server = express()

server.set('port', process.env.PORT || 3000)
server.use(express.logger('dev'))
server.use(express.json())
server.use(express.urlencoded())
server.use(express.methodOverride())

if (fs.existsSync(process.cwd() + '/public')) {
  server.use(express.static(process.cwd() + '/public'));
} else {
  server.use(express.static(path.join(__dirname, './public')));
}

server.use(cors())
server.use(server.router)

if ('development' == server.get('env')) {
  server.use(express.errorHandler());
}

server.get(   '/db'                          , routes.db)
server.get(   '/:resource'                   , routes.list)
server.get(   '/:parent/:parentId/:resource' , routes.list)
server.get(   '/:resource/:id'               , routes.show)

server.post(  '/:resource'                   , routes.create)

server.put(   '/:resource/:id'               , routes.update)
server.patch( '/:resource/:id'               , routes.update)

server.delete('/:resource/:id'               , routes.destroy)

server.low = low

module.exports = server
{'fraction_non_alphanumeric': 0.18584070796460178, 'fraction_numerical': 0.0029498525073746312, 'mean_word_length': 2.966374269005848, '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': '6385208', 'n_tokens_mistral': 861, 'n_tokens_neox': 864, 'n_words': 157}