<commit_before>'use strict';

var express = require('express');
var router = express.Router();

var Retriever = require('./retriever.js');

// ----------------------------------------------------------------------------------------
router.use(function(req, res, next){
  LOG.info("Request Time: " + Date.now());
  next();
});

// ----------------------------------------------------------------------------------------
router.get('/:project', function(req, res){
  var proj = req.params.project;
  
  if(validProject(req.params.project)){
    res.status(200).send("You have reached the " + req.params.project + " but its looking for a POST.");
    
  }else{
    res.status(404).end(); // project not found
  }
});

// ----------------------------------------------------------------------------------------
router.post('/:project/:key', function(req, res){
  
  if(validProject(req.params.project)){
    if(validKey(req.params.project, req.params.key)){
      var uri = req.body[CONFIG['projects'][req.params.project]['uri_form_field']];
      
      if(validUri(req.params.project, uri)){
        res.sendStatus(200).end();
      
        LOG.info('Request received for ' + req.params.project + ' - archive file at ' + uri);
      
        var retriever = new Retriever();
        retriever.retrieve(req.params.project, uri);
      
      }else{
        LOG.warn('Received a request for ' + req.params.project + ' with a valid key but wrong domain - ' + uri);<commit_msg>Removed incoming request logger because it was redundent and was creating a tremendous amount of noise from monit<commit_after>'use strict';

var express = require('express');
var router = express.Router();

var Retriever = require('./retriever.js');

// ----------------------------------------------------------------------------------------
router.get('/:project', function(req, res){
  var proj = req.params.project;
  
  if(validProject(req.params.project)){
    res.status(200).send("You have reached the " + req.params.project + " but its looking for a POST.");
    
  }else{
    res.status(404).end(); // project not found
  }
});

// ----------------------------------------------------------------------------------------
router.post('/:project/:key', function(req, res){
  
  if(validProject(req.params.project)){
    if(validKey(req.params.project, req.params.key)){
      var uri = req.body[CONFIG['projects'][req.params.project]['uri_form_field']];
      
      if(validUri(req.params.project, uri)){
        res.sendStatus(200).end();
      
        LOG.info('Request received for ' + req.params.project + ' - archive file at ' + uri);
      
        var retriever = new Retriever();
        retriever.retrieve(req.params.project, uri);
      
      }else{
        LOG.warn('Received a request for ' + req.params.project + ' with a valid key but wrong domain - ' + uri);
{'fraction_non_alphanumeric': 0.2933146657332867, 'fraction_numerical': 0.006300315015750788, 'mean_word_length': 1.7640232108317215, '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': '4758113', 'n_tokens_mistral': 772, 'n_tokens_neox': 760, 'n_words': 171}