<commit_before>const express = require('express');
const fs = require('fs');
const multer = require('multer');
const path = require('path');

const SlidCtrl = require('../controllers/slid.controller.js');

let slidCtrl = new SlidCtrl();
let router = express.Router();

const CONFIG = require('../../config.json');  

const storage = multer.diskStorage({
  destination: CONFIG.contentDirectory,
  filename: (req, file, cb) => {
    cb(null, utils.generateUUID() + "." + file.originalname.split('.').pop());
}
});

const upload = multer({ storage: storage});

router.route("/slids")
    // create slid
    .post(upload.single("file"), (request, response) => {
        slidCtrl.create(request.file, (err, data) => {
            if (err) console.log(err);
            response.send(err || data);
        });
    })
    // get all slids
    .get((request, response) => slidCtrl.list(data => response.send(data)));

    router.route("/slids/:slidId")
    // get 1 slid
    .get((request, response) => {
        slidCtrl.read(request.slidId, (err, data) => {
            if (err) console.log(err);
            response.send(err || data);
        });
    });

    router.param("slidId", (req, res, next, id) => {
        req.slidId = id;
        next();
    });

    router.post("/slids/content", upload.single("file"), function(request, response) {
        console.log(request);
    console.log(request.file.path); // The full path to the uploaded file
    console.log(request.file.originalname); // Name of the file on the user's computer
    console.log(request.file.mimetype); // Mime type of the file });
    response.send();
});
<commit_msg>FIX: 💩<commit_after>const express = require('express');
const fs = require('fs');
const multer = require('multer');
const path = require('path');

const SlidCtrl = require('../controllers/slid.controller.js');

let slidCtrl = new SlidCtrl();
let router = express.Router();

const CONFIG = require('../../config.json');  

const storage = multer.diskStorage({
  destination: CONFIG.contentDirectory,
  filename: (req, file, cb) => {
    cb(null, utils.generateUUID() + "." + file.originalname.split('.').pop());
}
});

const upload = multer({ storage: storage});

router.route("/slids")
    // create slid
    .post(upload.single("file"), (request, response) => {
        slidCtrl.create(request.file, (err, data) => {
            if (err) console.log(err);
            response.send(err || data);
        });
    })
    // get all slids
    .get((request, response) => slidCtrl.list(data => response.send(data)));

    router.route("/slids/:slidId")
    // get 1 slid
    .get((request, response) => {
        slidCtrl.read(request.slidId, (err, data) => {
            if (err) console.log(err);
            response.send(err || data);
        });
    });

    router.param("slidId", (req, res, next, id) => {
        req.slidId = id;
        next();
    });

    router.post("/slids/content", upload.single("file"), function(request, response) {
        console.log(request);
        console.log(request.file.path); // The full path to the uploaded file
        console.log(request.file.originalname); // Name of the file on the user's computer
        console.log(request.file.mimetype); // Mime type of the file });
        response.send();
});

{'fraction_non_alphanumeric': 0.18375418314572559, 'fraction_numerical': 0.000608457560085184, 'mean_word_length': 2.859154929577465, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, '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': '7285620', 'n_tokens_mistral': 1015, 'n_tokens_neox': 1008, 'n_words': 229}