README
apier-responsebuilder
Builds and sends the response of apier.
Installation
Download node at nodejs.org and install it, if you haven't already.
npm install apier-responsebuilder --save
API
init()
Used as middleware to initialize the response (that we will send at the end)
send(req, res, data)
req
Type: Object
The request object
res
Type: Object
The response object
data
Type: any
The data to send as response
error(req, res, errorCode)
req
Type: Object
The request object
res
Type: Object
The response object
errorCode
Type: String
The errorCode to send as response
Tests
npm install
npm test
Dependencies
- reqlog: A simple Node.js logger. Very closely attached to a request.
Dev Dependencies
- eslint: An AST-based pattern checker for JavaScript.
- eslint-config-google: ESLint shareable config for the Google style
License
MIT
Generated by package-json-to-readme