uh-responder

3.1.0 • Public • Published

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 :)

js-standard-style

Keywords

none

install

npm i uh-responder

Downloadsweekly downloads

2

version

3.1.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
Report a vulnerability