<commit_before>const Koa = require('koa');
const path = require("path");
import sendfile from 'koa-sendfile';
import cors from "kcors"
import IO from 'koa-socket'
import watch from 'node-watch'
const _ = require('koa-route');

const app = new Koa();
const io = new IO();

io.attach( app );

app.use(cors());

const store_path = path.join(__dirname, "pipelines.json");

watch(store_path, () => {
  io.broadcast("hi");
});

app.use(_.get('/api/pipelines', async (ctx) => {
  var stats = await sendfile(ctx, store_path);

  if(!stats) {
    ctx.body = [];
  }
}));

app.use(_.get('/', async (ctx) => {
  const index_path = path.join(__dirname, "index.html");
  await sendfile(ctx, index_path)
}));

app.listen(3000);<commit_msg>remove etag from response<commit_after>const Koa = require('koa');
const path = require("path");
import sendfile from 'koa-sendfile';
import cors from "kcors"
import IO from 'koa-socket'
import watch from 'node-watch'
import fs from 'fs'
const _ = require('koa-route');

const app = new Koa();
const io = new IO();

io.attach( app );

app.use(cors());

const store_path = path.join(__dirname, "pipelines.json");

watch(store_path, () => {
  io.broadcast("hi");
});

app.use(_.get('/api/pipelines', async (ctx) => {
  ctx.response.type = 'json';

  if (fs.existsSync(store_path)) {
    ctx.body = fs.createReadStream(store_path);
  } else {
    ctx.body = []
  }
}));

app.use(_.get('/', async (ctx) => {
  const index_path = path.join(__dirname, "index.html");
  await sendfile(ctx, index_path)
}));

app.listen(3000);
{'fraction_non_alphanumeric': 0.1931302657161374, 'fraction_numerical': 0.005184705119896306, 'mean_word_length': 4.455830388692579, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '6828800', 'n_tokens_mistral': 572, 'n_tokens_neox': 561, 'n_words': 131}