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: ''
          });
      }
      

      Javascript language logo
      create node ESM

      Node Recipes

      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

        Codiga - All rights reserved 2022.