promisify-express
This package allows you to wrap express so that you can use promises as handlers, and any promise error will be neatly passed to express error handlers.
Getting Started
Install the module with: npm install promisify-express --save
.
Documentation
Middleware and route handlers can simply return a promise. If the promise is rejected, promisify-express
will
call next
with the reason. This functionality removes the need to explicitly define a rejection handler.
// Without promisify-expressconst express = const app = app app // With promisify-expressconst express = const promisifyExpress = const app = app app