1.0.6 • Published 5 years ago

@yapsody/lib-handlers v1.0.6

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
5 years ago

@yapsody/yap-handlers

Handlers for Yapsody 3.0

Installation

npm i @yapsody/yap-handlers --save

Usage

// require the entire library
const handlers = require('@yapsody/yap-handlers');

// or require individual components
const { response } = require('@yapsody/yap-handlers')

return res.status(handlers.response.STATUS.OK)
  .send(handlers.response.getSuccessPayload(data));

return res.status(handlers.response.STATUS.BAD_REQUEST)
  .send(handlers.response.getErrorPayload('Bad Request', handlers.response.STATUS.BAD_REQUEST));

return res.status(handlers.response.STATUS.BAD_REQUEST)
  .send(handlers.response.getJoiValidationErrorPayload(error));

Changelog

See the changelog page on Gitlab.

1.0.6

5 years ago