<commit_before>part of schafkopfer_server;

/// Handles HTTP Requests

void root(HttpRequest request) {
  _sendText(request, 200, 'SchafkopferServer up and running :)');
}

void newMatch(HttpRequest request) {
  if (!_validContentType(request, ContentType.JSON)) {
    return;
  }
  UTF8.decodeStream(request).then((payload) {
    var json = JSON.decode(payload.toString());
    var playerNames = json['players'];
    if (!validateNames(playerNames)) {
      _sendText(request, 404, 'Error creating match for $playerNames');
      return;
    }
    new Documents().createMatch(playerNames).then((match) {  
      request.response.headers.add('Location', urls.MATCHES + match.id.toHexString());
      request.response.statusCode = 201;<commit_msg>removed smiley<commit_after>part of schafkopfer_server;

/// Handles HTTP Requests

void root(HttpRequest request) {
  _sendText(request, 200, 'SchafkopferServer up and running');
}

void newMatch(HttpRequest request) {
  if (!_validContentType(request, ContentType.JSON)) {
    return;
  }
  UTF8.decodeStream(request).then((payload) {
    var json = JSON.decode(payload.toString());
    var playerNames = json['players'];
    if (!validateNames(playerNames)) {
      _sendText(request, 404, 'Error creating match for $playerNames');
      return;
    }
    new Documents().createMatch(playerNames).then((match) {  
      request.response.headers.add('Location', urls.MATCHES + match.id.toHexString());
      request.response.statusCode = 201;
{'fraction_non_alphanumeric': 0.13288590604026845, 'fraction_numerical': 0.013422818791946308, 'mean_word_length': 4.344086021505376, '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': '2890357', 'n_tokens_mistral': 478, 'n_tokens_neox': 451, 'n_words': 92}