i've been using this tutorial :
To upload a file from React client side to Node.js server side. I'm havng an issue with the POST route given in the tutorial, VS Code shows a syntax error when pasting it. Can anyone re-arrange it? This is the route :
router.post("/upload", {
upload(req, res, (err) => {
console.log("Request ---", req.body);
console.log("Request file ---", req.file);//Here you get file.
/*Now do where ever you want to do*/
if(!err)
return res.send(200).end();
});
};);
It should be like this