Commit 3eb511f2 authored by Frauke's avatar Frauke
Browse files

Added comments

parent 3ce191fd
const express = require('express')
const app = express()
var multer = require('multer')
const multer = require('multer') // works only with multipart forms
const mime = require('mime-types')
var storage = multer.diskStorage({
const storage = multer.diskStorage({
destination: function (req, file, cb) {
cb(null, './files')
},
......@@ -19,8 +19,8 @@ app.use(function(req, res, next) {
});
app.post('/image', multer({ storage: storage }).single('file'), function (req, res) {
console.log(req.file)
console.log(req.body)
console.log(req.file) // the file you uploaded
console.log(req.body) // the other data of the form
})
app.listen(3030, () => console.log('server listening on port 3030!'))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment