flame/middleware/asyncWrapper.js
2021-10-22 00:42:27 +02:00

7 lines
166 B
JavaScript

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