0.0.1 • Published 7 years ago
send-json-response v0.0.1
Send-response
Instructions
Install the package :
npm install send-response
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)) }
You can add suggestions via issues
0.0.1
7 years ago