<commit_before>const express = require("express");
const compression = require("compression");
const debug = require("debug")("app:http");

const A_LONG_TIME = 1 /* year */ * 365 * 24 * 60 * 60;

const app = express();

app.use(compression());

app.use((req, res, next) => {
  if (req.query.v) {
    res.append("Cache-Control", `max-age=${A_LONG_TIME}, 1`);
  }
  if (req.path == "/scripts/service-worker.js")
    res.append("Service-Worker-Allowed", "/");
  next();
});

app.use(express.static(`${__dirname}/../../dist`));

app.get("/pong", (req, res) => {
  res.header("Access-Control-Allow-Origin", "*");
  // Reference<commit_msg>Remove typo (?) in cache control header<commit_after>const express = require("express");
const compression = require("compression");
const debug = require("debug")("app:http");

const A_LONG_TIME = 1 /* year */ * 365 * 24 * 60 * 60;

const app = express();

app.use(compression());

app.use((req, res, next) => {
  if (req.query.v) {
    res.append("Cache-Control", `max-age=${A_LONG_TIME}`);
  }
  if (req.path == "/scripts/service-worker.js")
    res.append("Service-Worker-Allowed", "/");
  next();
});

app.use(express.static(`${__dirname}/../../dist`));

app.get("/pong", (req, res) => {
  res.header("Access-Control-Allow-Origin", "*");
  // Reference
{'fraction_non_alphanumeric': 0.2370255615801704, 'fraction_numerical': 0.016266460108443067, 'mean_word_length': 4.168, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2447634', 'n_tokens_mistral': 463, 'n_tokens_neox': 445, 'n_words': 83}