0.0.1 • Published 7 years ago

send-json-response v0.0.1

Weekly downloads
3
License
ISC
Repository
github
Last release
7 years ago

Send-response

Instructions

  1. Install the package :

    npm install send-response
  2. Examples of how to use the package:

    const sendResponse = require('send-response')
    
    module.exports.addResource = (req, res, next) => {
    const resource = new Resource({ req.body })
    resource.save()
    .then(resource => sendResponse(res, 201, {id: resource._id}))
    .catch(err => handleError(err))
    }
  3. You can add suggestions via issues