express-async-middleware
v1.0.1
Published
Async middleware for express
Downloads
3
Readme
express-async-middleware
This an async middleware for express, used to catch errors from async functions and redirect them to the error handler.
Usage
const asyncMiddleware = require('express-async-middleware');
const fn = async (req, res) => {
// await something
res.send('ok');
};
app.get('/path', asyncMiddleware(fn));