const express = require('express');
const router = express.Router(),
const multer = require('multer');
const uploadFile = multer({
dest: __dirname + '../public/uploads/'
})
router.post('/upload', uploadFile, function(req, res) {
console.log('File uploaded successfully');
})
I encountered an error message stating
Route.post() requires callback functions
after trying to follow a tutorial on uploading photos. Could this be due to a newer version of Express being used? I recall the way middleware is added to a route as shown above, but for some reason it doesn't seem to work here.