uh-responder
v3.1.0
Published
Urbanhire API helper for give json response success or error
Downloads
7
Readme
uh-responder
Urbanhire API helper for give json response success or error
Usage
const uhResonseder = require('uh-responder')
app.use(uhResonseder())
// example response json output
const output = {
users,
companies
}
res.UHJson(output, extraData)
// example output with extraData fields
const output = {
users,
companies
}
const extraData = {
success: true
}
res.UHJson(output, extraData)
// example error response api
res.jsonError(new Error('Applicant Id is required'), 400)
This project uses JavaScript Standard Style - if the name or style choices bother you, you're gonna have to get over it :)