I have this middleware i'm trying to create for my app and i'm wondering on how to get the object's data, inside a separate function, so i can use it on a different function. Thanks in advance.
module.exports = {
myfunction: function(req, res, next) {
...
body:{
id:
}
...
},
process: function(req, res, next) {
const id = myfunction.body.id;
...
}
}
Error
ReferenceError: myfunction is not defined