Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jeromemacias/fastify-boom
Fastify Boom support - HTTP-friendly error objects
https://github.com/jeromemacias/fastify-boom
Last synced: 2 months ago
JSON representation
Fastify Boom support - HTTP-friendly error objects
- Host: GitHub
- URL: https://github.com/jeromemacias/fastify-boom
- Owner: jeromemacias
- License: mit
- Created: 2018-01-21T22:55:04.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T21:05:45.000Z (about 2 years ago)
- Last Synced: 2024-10-24T06:07:59.960Z (3 months ago)
- Language: JavaScript
- Size: 699 KB
- Stars: 13
- Watchers: 2
- Forks: 4
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-fastify - `fastify-boom`
README
# fastify-boom
Fastify Boom support - HTTP-friendly error objects
[![Current Version](https://img.shields.io/npm/v/fastify-boom.svg)](https://www.npmjs.com/package/fastify-boom)
[![Build Status](https://travis-ci.org/jeromemacias/fastify-boom.svg?branch=master)](https://travis-ci.org/jeromemacias/fastify-boom)## Install
```
npm i fastify-boom
```
## Usage
```js
const fastify = require('fastify')()
const Boom = require('boom')fastify.register(require('fastify-boom'))
fastify.get('/', async function (req, reply) {
throw new Boom('Opppps!')
})fastify.listen(3000, err => {
if (err) {
fastify.log.error(err)
}
})
```### Credits
- [boom](https://github.com/hapijs/boom) HTTP-friendly error objects