<commit_before>"use strict";

var express = require("express");
var router = express.Router();
var multer = require("multer");
var upload = multer({ dest: "./uploads/" });

router.post("/upload", upload.single("file"), function(req, res) {
  console.dir(req.file);
  res.send("File uploaded successfully");
});


module.exports = router;<commit_msg>move upload path to images/uploads and use a multer disk storage instead<commit_after>"use strict";

var express = require("express");
var router = express.Router();
var multer = require("multer");
var storage = multer.diskStorage({
  destination: function (req, file, cb) {
    cb(null, "./public/images/uploads");
  }
});
// var upload = multer({ dest: "./public/images" });
var upload = multer({ storage: storage });


router.post("/upload", upload.single("file"), function(req, res) {
  // create new Image here and save it
  res.send("File uploaded successfully");
});


module.exports = router;
{'fraction_non_alphanumeric': 0.17597471022128555, 'fraction_numerical': 0.0, 'mean_word_length': 4.864197530864198, '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': '1491572', 'n_tokens_mistral': 282, 'n_tokens_neox': 272, 'n_words': 83}