var express = require('express');
var router = express.Router();
const multer = require('multer');
const storage = multer.diskStorage({
destination: function (req, file, cb) {
cb(null, 'uploads/')
},
filename: function (req, file, cb) {
cb(null, file.originalname)
}
})
const upload = multer({storage: storage})
router.get('/', function(req, res, next) {
res.render('index', { title: 'Express' });
});
router.post('/profile', upload.single('avatar'), function (req, res, next) {
})
module.exports = router;