<commit_before>#!/usr/bin/env node

var express = require('express');
var cors = require('cors');
const path = require('path');
var app = express();
app.use(express.static(path.join(__dirname, 'quick-bench-front-end', 'build-bench', 'build')));
var bodyParser = require('body-parser');
var multer = require('multer');
const libbuild = require('src/libbuild');

const PORT = process.env.BB_PORT | 4000;

var upload = multer();

app.use(bodyParser.json());
app.use(cors());


app.post('/build', upload.array(), function (req, res) {
    Promise.resolve(libbuild.benchmark(req.body, req.headers))
        .then((done) => res.json(libbuild.makeBuildGraphResult(done)))
        .catch((err) => res.json({ messages: [err] }));
});

app.get('/build/:id', upload.array(), function (req, res) {<commit_msg>Fix import of libbuild<commit_after>#!/usr/bin/env node

var express = require('express');
var cors = require('cors');
const path = require('path');
var app = express();
app.use(express.static(path.join(__dirname, 'quick-bench-front-end', 'build-bench', 'build')));
var bodyParser = require('body-parser');
var multer = require('multer');
const libbuild = require('./src/libbuild');

const PORT = process.env.BB_PORT | 4000;

var upload = multer();

app.use(bodyParser.json());
app.use(cors());


app.post('/build', upload.array(), function (req, res) {
    Promise.resolve(libbuild.benchmark(req.body, req.headers))
        .then((done) => res.json(libbuild.makeBuildGraphResult(done)))
        .catch((err) => res.json({ messages: [err] }));
});

app.get('/build/:id', upload.array(), function (req, res) {
{'fraction_non_alphanumeric': 0.20809968847352026, 'fraction_numerical': 0.004984423676012461, 'mean_word_length': 5.083333333333333, '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': '4279534', 'n_tokens_mistral': 535, 'n_tokens_neox': 526, 'n_words': 111}