boomware
Opinionated Boom-based wrapper for asynchronous middleware (or handler) for Express, Connect, router, etc.
Installing
npm i --save boomware
Example
const boom = const boomware = const express = const app = // Middleware can return a Promise (but it doesn't have to)app app app
API
boomware(fn)
Returns a middleware function that catches a thrown error, wraps it
in an Boom.badImplementation
if it's not already a Boom error, and passes it to the next()
function. boomware
handles the case whenfn
return Promise, and the
case when fn
does not return a Promise.