<commit_before>import Vapor

// MARK: -- Properties
//let defaultHead: String = "<head><meta charset='utf-8'></head>"


// MARK: -- Configuration
print("\n Praeparando Nomina-Romanorum...")
print("Docendo artem operandi...")
let nameBuilder = NameBuilder() // create NameBuilder object
let drop = Droplet() //create Droplet object
print("Ars operandi docta est\n")
print("Configuratione completa est!\n\n")


// MARK: -- Program
print("Incipit executio!")
// MARK: Register routes and handlers
//default route -> name generation
drop.get { req in return nameBuilder.next() }

//Brusky's easter egg
drop.get("/brusky") { req in return "BRUSCHIIIIII!! \n PARACADUTE! PARACADUTE!" }

//my easter egg<commit_msg>Add path to request many names at once<commit_after>import Vapor

// MARK: -- Properties
let maxList: Int = 100 //Maximum amount of names which can be reqested in one shot
//let defaultHead: String = "<head><meta charset='utf-8'></head>"


// MARK: -- Configuration
print("\n Praeparando Nomina-Romanorum...")
print("Docendo artem operandi...")
let nameBuilder = NameBuilder() // create NameBuilder object
let drop = Droplet() //create Droplet object
print("Ars operandi docta est\n")
print("Configuratione completa est!\n\n")


// MARK: -- Program
print("Incipit executio!")
// MARK: Register routes and handlers
//default route -> name generation
drop.get { req in return nameBuilder.next() }

//get many names all at once
drop.get("list", Int.self) { req, amount in
  guard amount <= maxList else { //check we aren't requesting too many names
      return "ERROR: Parameter 'amount' must be a natural number between 0 and \(maxList).\nYou can't request more than \(maxList) names all at once.\n\nNon è possibile richiedere più di \(maxList) nomi in un colpo solo.\n"
  }
  var names: String = ""
  for i in 0 ..< amount {
    names += "\(nameBuilder.next())\n"
  }
  return names
}

//Brusky's easter egg
drop.get("/brusky") { req in return "BRUSCHIIIIII!! \n PARACADUTE! PARACADUTE!" }

//my easter egg
{'fraction_non_alphanumeric': 0.14250248262164847, 'fraction_numerical': 0.003475670307845084, 'mean_word_length': 3.8205741626794256, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '882586', 'n_tokens_mistral': 656, 'n_tokens_neox': 621, 'n_words': 224}