"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;

@@ -113,50 +113,228 @@
 var 
-upload = multer(%7B dest: %22./uploads/%22
+storage = multer.diskStorage(%7B%0A  destination: function (req, file, cb) %7B%0A    cb(null, %22./public/images/uploads%22);%0A  %7D%0A%7D);%0A// var upload = multer(%7B dest: %22./public/images%22 %7D);%0Avar upload = multer(%7B storage: storage
  %7D);%0A%0A
+%0A
 rout
@@ -402,30 +402,44 @@
 %7B%0A  
-console.dir(req.file);
+// create new Image here and save it
 %0A  r

move upload path to images/uploads and use a multer disk storage instead