<commit_before>let express = require('express');
let router = express.Router();
let mongo = require('../modules/database');

let feed = function (req, res) {

  'use strict';

  let domain = req.params.domain,
      tab = req.params[0].split('/')[1],
      allowedTabs = ['fatal', 'warnings', 'notice', 'javascript'];

  /**
   * TODO: check if domain registered
   */
  if (!allowedTabs.includes(tab)) {
    res.sendStatus(400);
    return;
  }

  if (!tab.length) tab = null;

  let query = {};

  if (tab) {
    query.tag = tab;
  }

  mongo.find(domain, query).then(function(result) {

    res.render('garage/list', { title: domain + '/' + tab , errors: result});

  });<commit_msg>fix route err<commit_after>let express = require('express');
let router = express.Router();
let mongo = require('../modules/database');

let feed = function (req, res) {

  'use strict';

  let domain = req.params.domain,
      tab = req.params[0].split('/')[1],
      allowedTabs = ['fatal', 'warnings', 'notice', 'javascript'];

  /**
   * TODO: check if domain registered
   */
  if (!allowedTabs.includes(tab)) {
    res.sendStatus(400);
    return;
  }

  if (!tab.length) tab = null;

  let query = {};

  if (tab) {
    query.tag = tab;
  }

  mongo.find(domain, query).then(function(result) {

    res.render('garage/index', { title: domain + '/' + tab , errors: result});

  });
{'fraction_non_alphanumeric': 0.1908230152949745, 'fraction_numerical': 0.007283321194464676, 'mean_word_length': 3.126126126126126, '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': '3998540', 'n_tokens_mistral': 477, 'n_tokens_neox': 452, 'n_words': 108}