<commit_before>'use strict'

const fastify = require('../fastify')()

const schema = {
  out: {
    type: 'object',
    properties: {
      hello: {
        type: 'string'
      }
    }
  }
}

fastify
  .get('/', schema, function (req, reply) {
    reply.header('Content-Type', 'application/json').code(200)
    reply.send({ hello: 'world' })
  })
  .post('/', schema, function (req, reply) {
    reply.send(null, { hello: 'world' })
  })
  .head('/', {}, function (req, reply) {
    reply.send(null)
  })
  .delete('/', schema, function (req, reply) {
    reply.send(null, { hello: 'world' })
  })
  .patch('/', schema, function (req, reply) {
    reply.send(null, { hello: 'world' })
  })

fastify.listen(3000, err => {
  if (err) throw err
  console.log(`server listening on ${fastify.server.address().port}`)
})<commit_msg>Update example for bench test<commit_after>'use strict'

const fastify = require('../fastify')()
const Promise = require('bluebird')

const schema = {
  out: {
    type: 'object',
    properties: {
      hello: {
        type: 'string'
      }
    }
  }
}

fastify
  .get('/', schema, function (req, reply) {
    // reply.header('Content-Type', 'application/json').code(200)
    // reply.send({ hello: 'world' })
    reply.header('content-type', 'text/plain').code(200).send('callback!')
  })
  .get('/promise', function (req, reply) {
    const promise = new Promise(function (resolve, reject) {
      resolve('promise!')
    })
    reply.header('content-type', 'text/plain').code(200).send(promise)
  })
  .post('/', schema, function (req, reply) {
    reply.send(null, { hello: 'world' })
  })
  .head('/', {}, function (req, reply) {
    reply.send(null)
  })
  .delete('/', schema, function (req, reply) {
    reply.send(null, { hello: 'world' })
  })
  .patch('/', schema, function (req, reply) {
    reply.send(null, { hello: 'world' })
  })

fastify.listen(3000, err => {
  if (err) throw err
  console.log(`server listening on ${fastify.server.address().port}`)
})
{'fraction_non_alphanumeric': 0.2095, 'fraction_numerical': 0.01, 'mean_word_length': 3.0753564154786153, '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': '2441868', 'n_tokens_mistral': 710, 'n_tokens_neox': 685, 'n_words': 150}