exports.succes = (req, res, message, status) => {
res.status(status || 200).send({
error: '',
body: message
});
}
exports.error = (req, res, message, status) => {
res.status(status || 500).send({
error: message,
body: ''
});
}
create node ESM
A snippet to create the error and the success methods on node.js with express
Shortcut: creNESM
0 Comments
Add Comment
Log in to add a comment