flame/middleware/asyncWrapper.js

8 lines
166 B
JavaScript
Raw Permalink Normal View History

function asyncWrapper(foo) {
return function (req, res, next) {
return Promise.resolve(foo(req, res, next)).catch(next);
};
}
module.exports = asyncWrapper;